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: [ {