Only uglify in production.
This commit is contained in:
parent
e04f46310d
commit
def02e77a7
3
.npmignore
Normal file
3
.npmignore
Normal file
@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
npm-debug.log
|
||||
package-lock.json
|
@ -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: [
|
||||
{
|
||||
|
Reference in New Issue
Block a user