Skip to content

Commit

Permalink
Merge pull request #896 from gabrielcsapo/gabrielcsapo/sourcemaps-opt…
Browse files Browse the repository at this point in the history
…-out

feat: adds a environment variable to opt out of source maps
  • Loading branch information
nlfurniss authored Dec 19, 2022
2 parents e7e706b + 82cd7f7 commit 5a1c5f1
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 5a1c5f1

Please sign in to comment.