evanw / evanw/esbuild

Feature Request: remove line and character position data from sourcemap

Open
#4,035 1 comment 0 reactions 0 assignees View on GitHub
sourcemap
Dominant language
Go
Stars
40.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Source maps are very large.
I only need the original filename (and original file path) for debugging stack traces.

There is an option to remove the `sourceContent`: https://esbuild.github.io/api/#sources-content
```
{
"version": 3,
"sources": ["bar.js", "foo.js"],
"sourcesContent": ["bar()", "foo()\nimport './bar'"],
"mappings": ";AAAA;;;ACAA;",
"names": []
}
```

A good feature is to limit the mappings data to just the original filename and original filepath WITH no line number and character information (Or map everything to line 0 character 0 of a given source file)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing esbuild's source-map generation and how the `mappings` field encodes original positions. Define the reduced mapping behavior and its interaction with `sources` and `sourcesContent`, then add coverage showing that generated maps retain original filenames and paths without line or character positions.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.