Merge pull request #792 from paulkaplan/fix-webpack-dev-server

Only uglify if building for production.
This commit is contained in:
Paul Kaplan 2017-11-17 12:32:41 -05:00 committed by GitHub
commit 8ce20fd308
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -5,13 +5,14 @@ node_js:
env: env:
- NPM_SCRIPT="tap:unit -- --jobs=4" - NPM_SCRIPT="tap:unit -- --jobs=4"
- NPM_SCRIPT="tap:integration -- --jobs=4" - NPM_SCRIPT="tap:integration -- --jobs=4"
- NODE_ENV=production
sudo: false sudo: false
cache: cache:
directories: directories:
- node_modules - node_modules
install: install:
- npm install - npm --production=false install
- npm update - npm --production=false update
script: npm run $NPM_SCRIPT script: npm run $NPM_SCRIPT
jobs: jobs:
include: include:

View file

@ -20,12 +20,12 @@ const base = {
} }
}] }]
}, },
plugins: [ plugins: process.env.NODE_ENV === 'production' ? [
new webpack.optimize.UglifyJsPlugin({ new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/, include: /\.min\.js$/,
minimize: true minimize: true
}) })
] ] : []
}; };
module.exports = [ module.exports = [