-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlavas.config.js
86 lines (83 loc) · 2.36 KB
/
lavas.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/**
* @file lavas config
* @author Tricker(tricker.pan@gmail.com)
*/
'use strict';
const path = require('path');
const BUILD_PATH = path.resolve(__dirname, 'dist');
const isDev = process.env.NODE_ENV === 'development';
const isProd = process.env.NODE_ENV === 'production';
module.exports = {
build: {
ssr: false,
path: BUILD_PATH,
publicPath: '/',
ssrCopy: isDev ? [] : [
{
src: 'server.prod.js'
},
{
src: 'package.json'
}
],
extend: function(config, context) {
if (context.type === 'base') {
config.module.rules[1].exclude = /node_modules(?![\\/]_vue-awesome@\d+\.\d+\.\d+@vue-awesome[\\/])/;
config.module.rules.push({
resource: path.join(__dirname, 'core/app.js'), // 应用loader的文件
loader: 'svg-loader',
enforce: 'pre' // 声明svg-loader最先执行
});
config.resolveLoader = {
alias: {
'svg-loader': path.join(__dirname, 'build/svg-loader')
}
};
}
},
nodeExternalsWhitelist: [
/vue-awesome/
],
},
router: {
mode: 'history',
base: '/',
pageTransition: {
type: 'fade',
transitionClass: 'fade'
}
},
icon: {
prefix: 'svg-',
svgDir: path.join(__dirname, 'assets/svg'),
icons: [
'envelope',
'home',
'map-marker',
'user',
'globe',
'cloud',
'qrcode',
'search',
'comment',
'bullhorn',
'star',
'star-half'
]
},
serviceWorker: {
swSrc: path.join(__dirname, 'core/service-worker.js'),
swDest: path.join(BUILD_PATH, 'service-worker.js'),
// swPath: '/custom_path/', // specify custom serveice worker file's path, default is publicPath
globDirectory: BUILD_PATH,
globPatterns: [
'**/*.{html,js,css,eot,svg,ttf,woff}'
],
globIgnores: [
'sw-register.js',
'**/*.map'
],
appshellUrl: '/appshell',
dontCacheBustUrlsMatching: /\.\w{8}\./
}
};