Skip to content

Commit

Permalink
change webpack devtool to 'eval' from 'source-map' (#829)
Browse files Browse the repository at this point in the history
See here for a comparison of webpack devtool options
https://webpack.js.org/configuration/devtool/

'source-map' is listed as one of the slowest options
for build, and is recommended for production builds
that want high quality source maps.
Changing this to 'eval' shaves off 0.5s from the build time,
while still providing a source map in dev mode.

J=SLAP-1373
TEST=manual

see ~0.5s shaved off the webpack build time
see that I get source maps in dev mode, and can
add a console log to a formatter and clicking on
the console.log's line number will take me to the
correct source line in dev tools
  • Loading branch information
oshi97 authored Jun 14, 2021
1 parent cc7f70d commit 6368b08
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion static/webpack-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ module.exports = function () {
];

const commonConfig = {
devtool: 'source-map',
stats: 'errors-warnings',
performance: {
maxAssetSize: 1536000,
Expand Down
1 change: 1 addition & 0 deletions static/webpack/webpack.dev.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = () => {
return {
mode: 'development',
devtool: 'eval',
optimization: {
minimize: false
}
Expand Down
1 change: 1 addition & 0 deletions static/webpack/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = () => {
const InlineAssetHtmlPlugin = require('./InlineAssetHtmlPlugin');
return {
mode: 'production',
devtool: 'source-map',
plugins: [
new InlineAssetHtmlPlugin()
],
Expand Down

0 comments on commit 6368b08

Please sign in to comment.