Skip to content

sourcemap support #8

Open
Open

Description

@leeoniya

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

Activity

  1. added
    enhancement
    help wanted
    and removed
    help wanted
    on Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions