Merge pull request #1173 from threehams/source-maps

Speed up sourcemaps in dev mode
This commit is contained in:
hydroflame 2021-09-06 13:05:13 -04:00 committed by GitHub
commit 91434b7972
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,7 +22,7 @@ module.exports = (env, argv) => {
chunkModules: false,
chunkOrigins: false,
colors: true,
entrypoints: true,
entrypoints: false,
};
const devServerSettings = {
@ -106,10 +106,25 @@ module.exports = (env, argv) => {
},
},
}),
],
// In dev mode, use a faster method of create sourcemaps
// while keeping lines/columns accurate
isDevServer &&
new webpack.EvalSourceMapDevToolPlugin({
// Exclude vendor files from sourcemaps
// This is a huge speed improvement for not much loss
exclude: ["vendor"],
columns: true,
module: true,
}),
!isDevServer &&
new webpack.SourceMapDevToolPlugin({
filename: "[file].map",
columns: true,
module: true,
}),
].filter(Boolean),
target: "web",
entry: entries,
devtool: "source-map",
output: {
path: path.resolve(__dirname, "./"),
filename: "[name].bundle.js",