-
Notifications
You must be signed in to change notification settings - Fork 0
/
lavas.config.js
68 lines (65 loc) · 1.66 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
/**
* @file lavas config
* @author qqw78901(qqw78901@126.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'
}
],
/**
* alias for webpack
*
* @type {Object.<string, Object>}
*/
alias: {
server: {
'iscroll/build/iscroll-lite$': path.join(__dirname, 'core/iscroll-ssr.js')
}
},
/**
* node externals
*
* @type {Array.<string|RegExp>}
*/
nodeExternalsWhitelist: [
/iscroll/
]
},
router: {
mode: 'hash',
base: '/',
pageTransition: {
type: 'slide',
transitionClass: 'slide'
}
},
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}\./
}
};