Closed mbehzad closed 4 years ago
I don't think it's possible to detect that source map reference EOL when sourcesContent
doesn't contain the EOL. Described mini-css-extract-plugin
behavior looks like a bug. mini-css-extract-plugin
should not generate mapping for EOL.
I'm thinking about disabling column/line boundaries check when analyzing a source map. These checks can be useful but they bring more troubles.
Use --no-border-checks
to disable invalid mapping column/line checks
thank you very much for the fast response!
Description Sometimes during compilation of files, some plugins will add an eol to the end of the output. e.g. mini-css-extract-plugin. During the source-map generation (e.g. by mozilla/source-map) a new segment will be added for the line ending without a reference to the original source (probably because the eol didn't come from the source). Which according to the source-map spec, segments with only one variable are allowed.
source-map-explorer when reading such a source-map throws InvalidMappingColumn error with the message:
might be related to https://github.com/danvk/source-map-explorer/issues/136
Steps to reproduce
css:
source-map:
run source-map-explorer with these files
Files to reproduce minimal repo: https://github.com/mbehzad/webpack-postcss-cssnano-source-map-issue
Expected behavior it would be great if source-map-explorer could detect that the column number bing one bigger that the line length and having no reference for the original source is because of a eol and ignore it.
Environment
Additional context output was generated by a webpack build using mini-css-extract-plugin and the css file was minified prior / as part of that.