Parcel emits an incorrect source map. Crucially, it makes no reference to the original source file a.scss. The contents of dist/a.css.map, pretty-printed, are:
The problem appears to be with the exclamation mark in the comment. The problem is that when importing CSS files from third party node modules, they can have such comments and so there is no simple way to ensure that such comments don't appear in the project's imported dependency stylesheets. The consequence is that if any CSS dependency contains a comment starting with an exclamation mark (quite common in CSS in npm modules), source maps don't work for the entire CSS bundle generated by Parcel.
🌍 Your Environment
Parcel version 2.12
Operating system: Linux
Node version 21.7.3
🐛 bug report
Parcel generates an incorrect source map for the following SCSS file (a.scss):
Command:
parcel build a.scss
🤔 Expected Behavior
Expected source map (dist/a.css.map) should contain a reference to the a.scss source file, and be something along the lines of
😯 Current Behavior
Parcel emits an incorrect source map. Crucially, it makes no reference to the original source file a.scss. The contents of dist/a.css.map, pretty-printed, are:
🔦 Context
The problem appears to be with the exclamation mark in the comment. The problem is that when importing CSS files from third party node modules, they can have such comments and so there is no simple way to ensure that such comments don't appear in the project's imported dependency stylesheets. The consequence is that if any CSS dependency contains a comment starting with an exclamation mark (quite common in CSS in npm modules), source maps don't work for the entire CSS bundle generated by Parcel.
🌍 Your Environment
Parcel version 2.12 Operating system: Linux Node version 21.7.3