Skip to content

Commit 62c885d

Browse files
Merge pull request #6840 from layer5io/leecalcote-patch-1
Disable sourcemaps for specific build stages
2 parents 2f628b2 + 7b8d8fa commit 62c885d

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
@@ -715,8 +715,10 @@ exports.onCreateWebpackConfig = ({ actions, stage, getConfig }) => {
715715
},
716716
});
717717

718-
if (stage === "build-javascript") {
718+
// Reduce memory pressure by disabling sourcemaps in dev and build
719+
if (stage === "develop" || stage === "develop-html" || stage === "build-javascript" || stage === "build-html") {
719720
const config = getConfig();
721+
config.devtool = false;
720722
const miniCssExtractPlugin = config.plugins.find(
721723
(plugin) => plugin.constructor.name === "MiniCssExtractPlugin"
722724
);

0 commit comments

Comments
 (0)