Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sourcemap support #8

Open
leeoniya opened this issue Apr 10, 2019 · 0 comments
Open

sourcemap support #8

leeoniya opened this issue Apr 10, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@leeoniya
Copy link
Owner

leeoniya commented Apr 10, 2019

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

@leeoniya leeoniya added enhancement New feature or request help wanted Extra attention is needed and removed help wanted Extra attention is needed labels Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant