Skip to content

[Feature Request]: Generate source maps without original source code #5554

@I-Enderlord-I

Description

@I-Enderlord-I

What problem does this feature solve?

Currently, generated source maps always include the original untransformed source code in their sourcesContent field. This is useful for more in depth debugging, but when only correct line/column references in errors are required, it's unnecessary bloat in the final bundle when inlining the source maps and prevents obscuring the code with minification.

Both esbuild and rollup have options to leave out sourcesContent. This allows keeping the position references to the original code without having to include it.

What does the proposed API look like?

A boolean property should be added to the output options object. To keep the API similar, naming it either sourcemapExcludeSources like Rollup or sourcesContent like in esbuild would be best.

Of note is that those two existing solutions use opposing values. The Rollup flag removes the sources when true, while esbuild's optins needs to be set to false.

Metadata

Metadata

Assignees

No one assigned

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions