Closed roryashfordbentley closed 9 years ago
v2.0.0-beta is just released with some source-map improvements and new options introduced. Please test and let us know if this issue still persist.
Hi @am11 - I'm prepping meteor-scss for the new version, since I've never managed to get sourcemaps working, but I'm experiencing issues with the 2.0.0-beta. Given a very simple input file
// meteor-scss-test.scss
@import "imports";
/* CSS declarations go here */
body {
background-color: blue;
p {
font-size: $font-size;
}
}
// _imports.scss
$font-size: 100px;
Typing node-sass --output-style compressed --source-map out.map.css meteor-scss-test.scss out.css
gives a out.map.css
file containing:
[object Object]
@fourseven, I can reproduce this bug. It is coming from https://github.com/sass/node-sass/blob/974f93e76ddd08ea850e3e663cfe64bb6a059dd3/lib/render.js#L63. Changing it to
fs.writeFile(options.sourceMap, JSON.stringify(result.map), function(err) {
will fix it.
I am debugging other things at the moment. Will push the fix momentarily. We will probably have beta2 soon. Meanwhile, you can manually apply the aforementioned fix in render.js
.
Thanks for reporting the issue. :+1:
Thanks @am11 - Trying to inject that sort of fix though meteor.js sounds like a world of pain, so I'll wait for the next published beta and will open anything if I run into other issues. I like the new API, makes heaps more sense, nice!
@fourseven, that bug is fixed by 9fbb239 via https://github.com/sass/node-sass/pull/583. Credit goes to @didoarellano. :congratulations:
This issue is fixed in v2.0.0.
You released v2.0.0? SWEET! :tada: :balloon:
Yay! Checkout the release notes: https://github.com/sass/node-sass/releases/tag/v2.0.0. :)
Trying to get sourcemaps working using the following command line args:
node-sass --output-style compressed --source-map assets/sass/style.scss style.css
My css file is created as is style.map.css which is also referenced in the CSS file, so far so good. When I try to use the sourcemap in Chrome (latest release) it doesn't recognise it, so I started exsperimenting.
I noticed by adding a path following the --source-map creates a sourcemap with a differnt filename e.g.
node-sass --output-style compressed --source-map test.css.map assets/sass/style.scss style.css
.The new file
test.css.map
is created and has different output to the default style.css.map file.style.css.map (created without --source-map additional filename arg) output:
test.css.map output:
There is a big difference between the two. I noticed that if I do add the custom filename that it isn't reflected in the stylesheet which still has
/*# sourceMappingURL=style.css.map */
at the bottom rather than pointing to the newly named/created file.I have also observed that if I point the CSS file to the newly named
test.css.map
that it works perfectly in Chrome. This all maybe because I am jumping the gun using features not fully documented in v1.2.3.