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