Skip to content

Commit

Permalink
feat: adds a environment variable to opt out of source maps
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcsapo committed Jun 15, 2022
1 parent f82d318 commit 02c9b90
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/fastboot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ FastBoot.distPath // readOnly accessor that provides the dist path for the curre

### Additional configuration

> 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.
`app.visit` takes a second parameter as `options` above which a map and allows to define additional optional per request
configuration:

Expand Down
12 changes: 8 additions & 4 deletions packages/fastboot/src/ember-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ class EmberApp {
this.config = allConfig;
}

this.scripts = buildScripts([
require.resolve('./scripts/install-source-map-support'),
...config.scripts,
]);
if (process.env.FASTBOOT_SOURCEMAPS_DISABLE) {
this.scripts = buildScripts([...config.scripts]);
} else {
this.scripts = buildScripts([
require.resolve('./scripts/install-source-map-support'),
...config.scripts,
]);
}

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

0 comments on commit 02c9b90

Please sign in to comment.