Skip to content

Commit a9b2de8

Browse files
authored
feat(gatsby): Enable source maps when compiling Gatsby files in development (#36450)
1 parent 5b3b565 commit a9b2de8

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

docs/docs/debugging-the-build-process.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ We won't go in depth here about how to debug in VS Code - for that you can check
9595
"request": "launch",
9696
"program": "${workspaceRoot}/node_modules/.bin/gatsby",
9797
"args": ["develop"],
98+
"env": {
99+
"PARCEL_WORKERS": "0",
100+
"GATSBY_CPU_COUNT": "1",
101+
},
98102
"runtimeArgs": ["--nolazy"],
99103
"console": "integratedTerminal"
100104
},
@@ -104,6 +108,10 @@ We won't go in depth here about how to debug in VS Code - for that you can check
104108
"request": "launch",
105109
"program": "${workspaceRoot}/node_modules/.bin/gatsby",
106110
"args": ["build"],
111+
"env": {
112+
"PARCEL_WORKERS": "0",
113+
"GATSBY_CPU_COUNT": "1",
114+
},
107115
"runtimeArgs": ["--nolazy"],
108116
"console": "integratedTerminal"
109117
}
@@ -126,6 +134,10 @@ We won't go in depth here about how to debug in VS Code - for that you can check
126134
"program": "${workspaceRoot}/node_modules/gatsby/dist/bin/gatsby"
127135
},
128136
"args": ["develop"],
137+
"env": {
138+
"PARCEL_WORKERS": "0",
139+
"GATSBY_CPU_COUNT": "1",
140+
},
129141
"runtimeArgs": ["--nolazy"],
130142
"console": "integratedTerminal"
131143
},
@@ -138,6 +150,10 @@ We won't go in depth here about how to debug in VS Code - for that you can check
138150
"program": "${workspaceRoot}/node_modules/gatsby/dist/bin/gatsby"
139151
},
140152
"args": ["build"],
153+
"env": {
154+
"PARCEL_WORKERS": "0",
155+
"GATSBY_CPU_COUNT": "1",
156+
},
141157
"runtimeArgs": ["--nolazy"],
142158
"console": "integratedTerminal"
143159
}

packages/gatsby/src/utils/parcel/compile-gatsby-files.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function constructParcel(siteRoot: string, cache?: Cache): Parcel {
4141
root: {
4242
outputFormat: `commonjs`,
4343
includeNodeModules: false,
44-
sourceMap: false,
44+
sourceMap: process.env.NODE_ENV === `development`,
4545
engines: {
4646
node: _CFLAGS_.GATSBY_MAJOR === `5` ? `>= 18.0.0` : `>= 14.15.0`,
4747
},

0 commit comments

Comments
 (0)