Serpack
Apis
Sourcemap

Sourcemap

WARNING

🚧 The sourcemap generation is still under development.
Typescript
compile('src/index.ts', {
  sourcemap: true,
  sourcemapOptions: {
    sourcemapRoot: process.cwd(),
  },
});

Set sourcemap to true to enable source map generation.

Sourcemap generator converts the paths in the source map from absolute to relative based on sourcemapOptions.sourcemapRoot (default: process.cwd()).

#CLI

Terminal
npx serpack ./index.ts --sourcemap=true

Or, if you want to specify the sourcemap path directly:

Terminal
npx serpack ./index.ts --sourcemap=index.js.map