nDmitry / grunt-autoprefixer

Parse CSS and add vendor-prefixed CSS properties using the Can I Use database. Based on Autoprefixer.
MIT License
794 stars 60 forks source link

map.sourceContent option ignored unless map.inline:true #91

Closed menzer closed 9 years ago

menzer commented 9 years ago

Expected behavior: setting map.sourceContent: false doesn't generate sourcesContent in source map Observed behavior: map.sourceContent only affects the source map file when map.inline: true, but the inline source map still contains sourcesContent

This is harmful because the sourcesContent output breaks variable linking.


I noticed that with grunt-autoprefixer running, cmd-clicking a value set by a variable no longer linked to the variable definition, and instead linked to the rule. After experimenting with various settings, I found that the sourcesContent property in the source map file seems incompatible with Chrome's variable linking.

I set map.sourceContent:false, and found that grunt-autoprefixer was still generating source maps with sourcesContent. The only time sourcesContent seemed to work was when inline source maps were generated, which still contain the sourcesContent, and still break Chromes variable linking.

nDmitry commented 9 years ago

The option is sourcesContent, so there is a nasty typo in the readme (sorry). Does the correct spelling solve the problem?

menzer commented 9 years ago

Yep, that seems to work as expected. Thanks!