For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

Angular 17+ (application builder)

esbuild

dist/<project>/browser

Yes

Angular 8–16 (browser builder)

webpack

dist/<project>

No (Angular 8–12 also emits -es5 copies)

React with Vite

Vite (Rollup)

dist

Yes

React with Create React App

webpack

build

No

Vue 3 with Vite

Vite

dist

Yes

Vue with Vue CLI

webpack

dist

No

Svelte, Solid, Preact, Lit or plain JS with Vite

Vite

dist

Yes

Any app with a custom webpack config

webpack 5

output.path

Only with output.module

Any app built with esbuild

esbuild

outdir

With --format=esm

Any app built with Rsbuild or Rspack

Rspack

dist

No (default)

Libraries and apps built with Rollup

Rollup

output.dir

With format: 'es'

Micro-frontends, Module Federation

any

each app's output

per app

Next.js

webpack / Turbopack

.next/static (client) + .next (server)

Yes

What every setup has in common

  1. Source maps with column information, next to the bundles at scan time. slnodejs finds a source map from an inline map, from the sourceMappingURL comment, or from a file named <bundle>.js.map in the same folder. "Hidden" source maps (no comment) therefore work, as long as the .map file sits next to the bundle with that name. "Cheap" (line-only) and eval source maps do not work.

  2. Scan the build output, not the source folder. slnodejs scan --instrumentForBrowsers --outputPath sl_dist writes the instrumented copy.

  3. --es6Modules only when the output is ES modules. Check: if the page loads the bundles with <script type="module">, or the bundles contain top-level import / export statements, add it. Without it, ES module bundles produce the dashboard warning File '<file>' parsed to AST with the following error(s): ....

  4. Deploy sl_dist instead of the build output, to test environments only.

  5. Framework code is not instrumented. By default, slnodejs skips Angular, React, Vue, Svelte, Stencil, core-js and regenerator-runtime code inside your bundles (as resolved from source maps). To skip more packages, create a .slignore.instrument file. 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:

Your output contains
Set

.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?