sourcemap support
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 2.1k
- Forks
- 64
- PR merge metrics
- No merged PRs in 30d
Description
i've personally not needed it, but it could be a quality of life improvement.
probably via https://github.com/Rich-Harris/magic-string but not sure how useful it would be without also ingesting a prior sourcemap, so also https://github.com/Rich-Harris/sorcery.
performance is somewhat a concern since we now need to also store indices in the token list.
perhaps the better way to keep this optional and out of the core is to optionally return a list of indices alongside the token list with indications of which were removed and leave the actual work of doing the sourcemapping to an external wrapper instead of bloating the core.
dropcss({trackLocs: true})
{
css: ...,
locs: [
655, // index
12, // chars removed
928, // index
533, // chars removed
]
}
or better yet? add the location index as arg to shouldDrop(sel, loc) and let the consumer/wrapper accumulate the deleted array. (still behind an option flag).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named. First resolve whether support belongs in core or an external wrapper, and evaluate the proposed magic-string/sorcery approach against the optional index-tracking alternatives and performance concern. Done means a decided API and implementation scope for sourcemap support, with its optional behavior and performance tradeoffs specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, javascript
- Domain
- performance, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100