Only uglify in production.

This commit is contained in:
Dan 2017-12-26 21:25:24 -08:00
parent e04f46310d
commit def02e77a7
2 changed files with 8 additions and 4 deletions

3
.npmignore Normal file
View File

@ -0,0 +1,3 @@
node_modules
npm-debug.log
package-lock.json

View File

@ -1,8 +1,9 @@
'use strict' 'use strict'
var path = require('path') const path = require('path')
var webpack = require('webpack') const webpack = require('webpack')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const production = process.argv.indexOf('-p') !== -1
module.exports = { module.exports = {
devtool: 'source-map', devtool: 'source-map',
@ -16,9 +17,9 @@ module.exports = {
sourceMapFilename: '[name].js.map', sourceMapFilename: '[name].js.map',
publicPath: '/ipfs/' publicPath: '/ipfs/'
}, },
plugins: [ plugins: production ? [
new UglifyJSPlugin({sourceMap: true}) new UglifyJSPlugin({sourceMap: true})
], ] : [],
module: { module: {
loaders: [ loaders: [
{ {