Skip to content

Commit

Permalink
Do not create source maps for production build (#486)
Browse files Browse the repository at this point in the history
Yesterday, I noticed that our production build is quite big. Just our `app.js.map` has already 1.5 MB. I think we don't need to ship source maps and therefore I disabled source maps for the production build.
  • Loading branch information
stefanbuck authored Jul 21, 2018
1 parent aa03035 commit d06cda8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"package": "yarn build && web-ext build --source-dir dist --artifacts-dir out --overwrite-dest",
"release": "webstore upload --source dist --auto-publish",
"build": "webpack --mode=production",
"watch": "webpack --watch",
"watch": "webpack --watch --mode=development",
"chrome-open": "yarn build && yarn chrome-launch --",
"chrome-launch": "node scripts/chrome-launch.js",
"firefox-open": "yarn build && yarn firefox-launch --",
Expand Down
6 changes: 3 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin'); // eslint-disable-line

module.exports = {
module.exports = (env, argv) => ({
mode: 'development',
entry: {
app: './packages/core/app',
background: './packages/core/background/index',
options: './packages/helper-settings/page',
},
devtool: 'source-map',
devtool: argv.mode === 'development' ? 'source-map' : '',
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
Expand All @@ -27,4 +27,4 @@ module.exports = {
},
],
},
};
});

0 comments on commit d06cda8

Please sign in to comment.