Turn off sourcemaps in production
Luke Karrys committed
Oct 20, 2023 at 17:33 UTC
0dc94356da2a852270578cd4eb5a06261a3035af
1 file changed
+7
-1
gatsby-node.js
+7
-1
@@ -63,7 +63,7 @@ exports.onCreateNode = ({node, actions, getNode}) => {
63
}
64
}
65
66
-exports.onCreateWebpackConfig = ({actions}) => {
66
+exports.onCreateWebpackConfig = ({stage, actions}) => {
67
actions.setWebpackConfig({
68
resolve: {
69
alias: {
@@ -72,6 +72,12 @@ exports.onCreateWebpackConfig = ({actions}) => {
72
extensions: ['.js'],
73
},
74
})
75
+
76
+ if (stage === `build-javascript`) {
77
+ actions.setWebpackConfig({
78
+ devtool: false,
79
+ })
80
+ }
81
}
82
83
exports.createSchemaCustomization = ({actions: {createTypes}}) => {