Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds a environment variable to opt out of source maps #896

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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