Framework and Bundler Setups
Complete setups for the most common front-end stacks. Each page shows the source map configuration, the output folder to scan, whether the output is ES modules, and the exact slnodejs commands.
Stack
Bundler
Output to scan
ES module output (--es6Modules)
Page
What every setup has in common
Source maps with column information, next to the bundles at scan time.
slnodejsfinds a source map from an inline map, from thesourceMappingURLcomment, or from a file named<bundle>.js.mapin the same folder. "Hidden" source maps (no comment) therefore work, as long as the.mapfile sits next to the bundle with that name. "Cheap" (line-only) andevalsource maps do not work.Scan the build output, not the source folder.
slnodejs scan --instrumentForBrowsers --outputPath sl_distwrites the instrumented copy.--es6Modulesonly when the output is ES modules. Check: if the page loads the bundles with<script type="module">, or the bundles contain top-levelimport/exportstatements, add it. Without it, ES module bundles produce the dashboard warningFile '<file>' parsed to AST with the following error(s): ....Deploy
sl_distinstead of the build output, to test environments only.Framework code is not instrumented. By default,
slnodejsskips Angular, React, Vue, Svelte, Stencil,core-jsandregenerator-runtimecode inside your bundles (as resolved from source maps). To skip more packages, create a.slignore.instrumentfile. It replaces the built-in list, so copy the entries for your framework into it:# Angular @angular/ zone.js rxjs tslib # React react react-dom react-is scheduler prop-types # Vue vue @vue/ vue-router vuex pinia # Svelte, Stencil svelte @sveltejs/ @stencil/core # Polyfills core-js regenerator-runtime # Your additions, for example: @mui/
Scanned file types
By default slnodejs scans and instruments .js, .jsx, .mjs and .es6 files. To change the list, set SL_fileExtensions on the scan step, with every extension you need:
.cjs files
SL_fileExtensions=.js,.mjs,.cjs
Inline <script> blocks in .html pages that you want covered
SL_fileExtensions=.js,.mjs,.html
Inline scripts in FreeMarker templates
SL_fileExtensions=.js,.ftl
Before you run it in CI
Check the scan locally with dryRun, which shows the included files and how source maps resolve:
Then follow Setting Up Browser Coverage → Check that it works after the first deployment. All flags are explained in the Flags and Settings Guide.
Last updated
Was this helpful?

