Skip to content

@charset insertion produces invalid source maps #879

@jonrimmer

Description

@jonrimmer

If a file contains an UTF-8 character, then the @charset "UTF-8" line that is inserted is not taken into account by the source map generation, causing every mapping to be one line off. E.g. the following will produce an invalid source map file:

div::before {
  content: '';
}

By itself this is an annoyance, but if the generated file is consumed by another tool, such as Autoprefixer, it plays absolute havoc with the build pipeline's attempts to combine the two generated source maps together, and the resulting map file is unusable.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions