Skip to content

Commit 82cd7f7

Browse files
committed
feat: adds a environment variable to opt out of source maps
1 parent e7e706b commit 82cd7f7

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

packages/fastboot/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ FastBoot.distPath // readOnly accessor that provides the dist path for the curre
6060

6161
### Additional configuration
6262

63+
> By default source maps are enabled by the source-maps-support package. Setting an environment variable `FASTBOOT_SOURCEMAPS_DISABLE=true` will bypass this package effectively disabling source maps support.
64+
6365
`app.visit` takes a second parameter as `options` above which a map and allows to define additional optional per request
6466
configuration:
6567

packages/fastboot/src/ember-app.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,14 @@ class EmberApp {
5454
this.config = allConfig;
5555
}
5656

57-
this.scripts = buildScripts([
58-
require.resolve('./scripts/install-source-map-support'),
59-
...config.scripts,
60-
]);
57+
if (process.env.FASTBOOT_SOURCEMAPS_DISABLE) {
58+
this.scripts = buildScripts([...config.scripts]);
59+
} else {
60+
this.scripts = buildScripts([
61+
require.resolve('./scripts/install-source-map-support'),
62+
...config.scripts,
63+
]);
64+
}
6165

6266
// default to 1 if maxSandboxQueueSize is not defined so the sandbox is pre-warmed when process comes up
6367
const maxSandboxQueueSize = options.maxSandboxQueueSize || 1;

0 commit comments

Comments
 (0)