Browse Source

Use external source map

master
Vitaliy Filippov 3 years ago
parent
commit
31e860f359
  1. 6
      package.json
  2. 8
      webpack.config.js

6
package.json

@ -32,9 +32,9 @@
"webpack-cli": "^3.1.2"
},
"scripts": {
"compile": "webpack --mode=production --optimize-minimize; nodejs copy-css.js",
"stats": "NODE_ENV=production webpack --mode=production --optimize-minimize --profile --json > stats.json; webpack-bundle-analyzer stats.json -h 0.0.0.0",
"watch-dev": "NODE_ENV=development webpack --mode=development -w",
"compile": "webpack --mode=production --optimize-minimize",
"stats": "webpack --mode=production --optimize-minimize --profile --json > stats.json; webpack-bundle-analyzer stats.json dist -h 0.0.0.0",
"watch-dev": "webpack --mode=development -w",
"watch": "webpack --mode=production -w --optimize-minimize"
}
}

8
webpack.config.js

@ -1,7 +1,7 @@
const webpack = require('webpack');
const path = require('path');
module.exports = {
module.exports = (env, argv) => ({
entry: {
main: [ "babel-polyfill", './main.js' ]
},
@ -10,7 +10,7 @@ module.exports = {
path: __dirname+'/dist',
filename: '[name].js'
},
devtool: 'inline-source-map',
devtool: 'cheap-module-source-map',
module: {
rules: [
{
@ -44,7 +44,7 @@ module.exports = {
plugins: [
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify(process.env.NODE_ENV || "production")
NODE_ENV: JSON.stringify(argv.mode || "production")
}
})
],
@ -52,4 +52,4 @@ module.exports = {
maxEntrypointSize: 5000000,
maxAssetSize: 5000000
}
};
});

Loading…
Cancel
Save