-
Notifications
You must be signed in to change notification settings - Fork 324
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
Source map reference fails in Edge/IE 11 #948
Comments
Thanks @RinkAttendant6 for flagging it. This is an easy fix. |
Quick question: clean-css can only control formatting of source map comment in the output CSS file (let's call it |
No the intermediate file ( Also is there any chance that this can be backported into the 3.x branch, as I'm not sure when the less plugin will be ready to support clean-css 4.x? |
Gotcha! No problem backporting the change to 3.4. |
Enforces line break before source map comment. Why: * Edge / IE doesn't like source map comment in the same line as other content whereas other browsers don't complain.
In 4.x the issue belongs to clean-css-cli repo - @RinkAttendant6 please note that in your case it's probably due to be solved in less-plugin-clean-css since it uses clean-css API so gets output in two pieces - styles and source map separately and then concatenates the result - see https://github.com/less/less-plugin-clean-css/blob/master/lib/clean-css-processor.js#L55 The fix to CLI is already on 3.4 branch. |
Fixed in 3.4.27. |
Problem
Microsoft Edge doesn't attempt to load the
.map
file due to the location of the source map comment in the CSS output.This is somewhat a known phenomenon (with both CSS and JavaScript): https://stackoverflow.com/q/34687049/404623
I also tried opening an issue at less/less-plugin-clean-css#21, but was redirected here.
Environment
npm ls clean-css
: 3.4.26node -v
: 0.10.3Configuration options
Not applicable. Default options passed by lessc I assume.
I am using this plugin: https://github.com/less/less-plugin-clean-css
Input CSS
main.less
without the less-plugin-clean-css plugin it generates the following CSS, which I assume is the input css:
Actual output CSS
Upon loading index.html in Microsoft Edge (which refers to main.css) and opening Debugger in the F12 Developer Tools, there is no request made to the server for the map file, and inspect element shows
main.css
references in the Styles panel instead ofmain.less
Expected output CSS
Edge should attempt to load the
main.css.map
file and refer to the code in themain.less
file in the Styles panel in the F12 Developer Tools.Manually editing the files to add the newline character fixes the problem but defeats the purpose of the build tool.
The text was updated successfully, but these errors were encountered: