To fix Webpack 4 "size exceeds the recommended limit (244 KiB)" error with JavaScript, we set devtool
to false
.
For instance, in webpack.config.js, we write
const mode = process.env.NODE_ENV || "development";
module.exports = {
//...
devtool: mode === "development" ? "inline-source-map" : false,
mode,
//...
};
to set devtool
to false
is mode
isn’t 'development'
.