From 6368b08ce9719f3251d67392708be3c04de0dc81 Mon Sep 17 00:00:00 2001 From: Oliver Shi Date: Mon, 14 Jun 2021 11:34:47 -0400 Subject: [PATCH] change webpack devtool to 'eval' from 'source-map' (#829) 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 --- static/webpack-config.js | 1 - static/webpack/webpack.dev.js | 1 + static/webpack/webpack.prod.js | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/static/webpack-config.js b/static/webpack-config.js index 2b429483f..979466cae 100644 --- a/static/webpack-config.js +++ b/static/webpack-config.js @@ -48,7 +48,6 @@ module.exports = function () { ]; const commonConfig = { - devtool: 'source-map', stats: 'errors-warnings', performance: { maxAssetSize: 1536000, diff --git a/static/webpack/webpack.dev.js b/static/webpack/webpack.dev.js index cd1b9546e..15ff8ee3d 100644 --- a/static/webpack/webpack.dev.js +++ b/static/webpack/webpack.dev.js @@ -1,6 +1,7 @@ module.exports = () => { return { mode: 'development', + devtool: 'eval', optimization: { minimize: false } diff --git a/static/webpack/webpack.prod.js b/static/webpack/webpack.prod.js index 5fff2d793..26ae8ca06 100644 --- a/static/webpack/webpack.prod.js +++ b/static/webpack/webpack.prod.js @@ -4,6 +4,7 @@ module.exports = () => { const InlineAssetHtmlPlugin = require('./InlineAssetHtmlPlugin'); return { mode: 'production', + devtool: 'source-map', plugins: [ new InlineAssetHtmlPlugin() ],