Browse Source

Only uglify in production.

Dan 1 year ago
parent
commit
def02e77a7
2 changed files with 8 additions and 4 deletions
  1. 3
    0
      .npmignore
  2. 5
    4
      webpack.config.js

+ 3
- 0
.npmignore View File

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

+ 5
- 4
webpack.config.js View File

@@ -1,8 +1,9 @@
1 1
 'use strict'
2 2
 
3
-var path = require('path')
4
-var webpack = require('webpack')
3
+const path = require('path')
4
+const webpack = require('webpack')
5 5
 const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
6
+const production = process.argv.indexOf('-p') !== -1
6 7
 
7 8
 module.exports = {
8 9
   devtool: 'source-map',
@@ -16,9 +17,9 @@ module.exports = {
16 17
     sourceMapFilename: '[name].js.map',
17 18
     publicPath: '/ipfs/'
18 19
   },
19
-  plugins: [
20
+  plugins: production ? [
20 21
     new UglifyJSPlugin({sourceMap: true})
21
-  ],
22
+  ] : [],
22 23
   module: {
23 24
     loaders: [
24 25
       {

Loading…
Cancel
Save