Skip to content

Commit ecb8e2e

Browse files
committed
New env and little fix in npmScript
1 parent 1909652 commit ecb8e2e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"hint-tests": "jshint --verbose test",
2828
"start": "npm-run-all --parallel dev-server dev-test",
2929
"test": "npm run hint-tests && npm run dev-test",
30-
"build": "npm run prod-builds && npm run prod-test && npm run hint-test"
30+
"build": "npm run prod-build && npm run prod-test && npm run hint-tests"
3131
},
3232
"devDependencies": {
3333
"babel-core": "^6.24.1",

webpack/config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const getBanner = () =>
1313
'License: ' + packageJSON.license;
1414

1515
const ENV = (process.env.npm_lifecycle_event.indexOf('dev') === 0) ? 'development' : 'production';
16+
const isTest = (process.env.npm_lifecycle_event.indexOf('dev-test') !== -1) ? true : false;
1617
console.log('********** webpack runs in ' + ENV + ' environment **********\n');
1718

1819
let configEnv;
@@ -39,7 +40,7 @@ if (ENV === 'development') {
3940

4041
plugins: [],
4142

42-
devServer: {
43+
devServer: !isTest ? {
4344
historyApiFallback: {
4445
rewrites: [
4546
{ from: '/dist/ui-scroll.js', to: (context) => '/ui-scroll.js' },
@@ -56,7 +57,7 @@ if (ENV === 'development') {
5657
port: 5005,
5758
stats: 'errors-only',
5859
publicPath: '/'
59-
},
60+
} : {},
6061

6162
watch: true
6263
}

0 commit comments

Comments
 (0)