-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpackage-scripts.js
More file actions
62 lines (61 loc) · 2 KB
/
Copy pathpackage-scripts.js
File metadata and controls
62 lines (61 loc) · 2 KB
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
const {series, crossEnv, concurrent, rimraf} = require('nps-utils')
const {config: {port : E2E_PORT}} = require('./test/protractor.conf')
module.exports = {
scripts: {
default: 'nps webpack',
transpile: series(
rimraf('dist'),
crossEnv('NODE_ENV=production babel src -d dist'),
'node-sass src/styles.scss dist/styles.css --output-style compressed'
),
test: {
default: 'nps test.jest',
jest: {
default: crossEnv('BABEL_TARGET=node jest'),
watch: crossEnv('BABEL_TARGET=node jest --watch'),
},
karma: {
default: series(
rimraf('test/karma-coverage'),
'karma start test/karma.conf.js'
),
watch: 'karma start test/karma.conf.js --single-run=false',
debug: 'karma start test/karma.conf.js --single-run=false --debug'
},
all: concurrent({
browser: series.nps('test.karma', 'e2e'),
jest: 'nps test.jest',
})
},
e2e: {
default: concurrent({
webpack: `webpack-dev-server --inline --port=${E2E_PORT}`,
protractor: 'nps e2e.whenReady',
}) + ' --kill-others --success first',
protractor: {
install: 'webdriver-manager update',
default: series(
'nps e2e.protractor.install',
'protractor test/protractor.conf.js'
),
debug: series(
'nps e2e.protractor.install',
'protractor test/protractor.conf.js --elementExplorer'
),
},
whenReady: series(
`wait-on --timeout 120000 http-get://localhost:${E2E_PORT}/index.html`,
'nps e2e.protractor'
),
},
webpack: {
default: 'nps webpack.server',
server: {
default: `webpack-dev-server -d --devtool '#eval' --inline --env.server`,
extractCss: `webpack-dev-server -d --devtool '#eval' --inline --env.server --env.extractCss`,
hmr: `webpack-dev-server -d --devtool '#eval' --inline --hot --env.server`
}
},
serve: 'http-server dist --cors',
},
}