Skip to content

Commit 3ef46bd

Browse files
committed
build performance
Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
1 parent 2b027e9 commit 3ef46bd

4 files changed

Lines changed: 1552 additions & 132 deletions

File tree

.env.development

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
GATSBY_GRAPHQL_IDE=playground
2+
# Reduce concurrency to lower memory use during develop
3+
GATSBY_CPU_COUNT=2
4+
SHARP_CONCURRENCY=2

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)