From def02e77a7fd90047a4a34a6cf8728f5105b3a4a Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 26 Dec 2017 21:25:24 -0800 Subject: [PATCH] Only uglify in production. --- .npmignore | 3 +++ webpack.config.js | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..55fda48 --- /dev/null +++ b/.npmignore @@ -0,0 +1,3 @@ +node_modules +npm-debug.log +package-lock.json diff --git a/webpack.config.js b/webpack.config.js index 1279709..2c2c5d4 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,8 +1,9 @@ 'use strict' -var path = require('path') -var webpack = require('webpack') +const path = require('path') +const webpack = require('webpack') const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); +const production = process.argv.indexOf('-p') !== -1 module.exports = { devtool: 'source-map', @@ -16,9 +17,9 @@ module.exports = { sourceMapFilename: '[name].js.map', publicPath: '/ipfs/' }, - plugins: [ + plugins: production ? [ new UglifyJSPlugin({sourceMap: true}) - ], + ] : [], module: { loaders: [ {