-
Notifications
You must be signed in to change notification settings - Fork 9
/
package-scripts.js
41 lines (40 loc) · 1.12 KB
/
package-scripts.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
const {series, crossEnv, concurrent, rimraf} = require('nps-utils')
module.exports = {
scripts: {
default: 'serve',
serve: 'nps webpack.serve',
build: 'nps webpack.build',
webpack: {
default: 'nps webpack.serve',
build: {
before: rimraf('dist'),
default: 'nps webpack.build.production',
development: {
default: series(
'nps webpack.build.before',
'webpack --progress -d'
),
server: series.nps(
'webpack.build.development',
'server'
),
},
production: {
default: series(
'nps webpack.build.before',
crossEnv('NODE_ENV=production webpack --progress --env.production')
),
server: series.nps(
'webpack.build.production',
'server'
),
}
},
serve: {
default: `webpack-dev-server -d --devtool '#source-map' --inline --env.server`,
hmr: `webpack-dev-server -d --devtool '#source-map' --inline --hot --env.server`
},
},
server: 'http-server dist --cors',
},
}