Skip to content

Commit c805f8b

Browse files
authored
Disable sourcemaps for specific build stages
Disable sourcemaps in development and build stages to reduce memory pressure. Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
1 parent 18e2267 commit c805f8b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

gatsby-node.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,8 +1069,10 @@ exports.onCreateWebpackConfig = ({ actions, stage, getConfig }) => {
10691069
},
10701070
});
10711071

1072-
if (stage === "build-javascript") {
1072+
// Reduce memory pressure by disabling sourcemaps in dev and build
1073+
if (stage === "develop" || stage === "develop-html" || stage === "build-javascript" || stage === "build-html") {
10731074
const config = getConfig();
1075+
config.devtool = false;
10741076
const miniCssExtractPlugin = config.plugins.find(
10751077
(plugin) => plugin.constructor.name === "MiniCssExtractPlugin"
10761078
);

0 commit comments

Comments
 (0)