-
Notifications
You must be signed in to change notification settings - Fork 361
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
Broken applied result #242
Comments
I have managed to reduce this down to a minimal test case: var sourceMap = require('source-map')
var map = {
"version": 3,
"file": "sass.css",
"sources": [
"sass.scss"
],
"mappings": "AAAA,AAAA,CAAC,CAAC;EACA,CAAC,EAAE,CAAE,GAIN;EALD,AAEE,CAFD,CAEC,CAAC,CAAC;IACA,CAAC,EAAE,CAAE,GACN",
"names": [],
"sourceRoot": ""
}
var consumer = new sourceMap.SourceMapConsumer(map)
console.log(consumer.originalPositionFor({line: 3, column: 2}))
// Actual:
// { source: 'sass.scss', line: 1, column: 0, name: null }
// Expected:
// { source: 'sass.scss', line: 3, column: 2, name: null } This visualization of map in the code above shows that the character at line 3 column 2 maps back to line 3 column 2. |
I added this at the end of the code snippet in my last comment: consumer.eachMapping(function (m) {
console.log(m)
})
|
I've run into this as well, but I tend to think that the library should work on a GIGO principle. That is, it can pick either mapping and that's ok -- there's no way to guess which one is more correct. It would be good, though, to ensure that this library doesn't generate duplicate mappings.
Nothing, unfortunately. |
Duplicate of #61 |
I uses your awesome
source-map
in PostCSS to generate new source map and apply old to new one (merge them).I have a report, that result after apply is broken. But I have no idea what I do wrong. Maybe I don’t understand something. Or maybe we really have issue in
source-map
here.Look at
#board a
selector, after apply it miss a mapping.In PostCSS I apply map in common way:
Origin issue was created by @winamp and he provided good playground for this issue.
@fitzgen tell me if you need more information
The text was updated successfully, but these errors were encountered: