-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Wrong path used for sourceMap #425
Comments
fixes sass#425 - Use path.basename
I agree it's not straight forward. These changes are in accordance to those made in libsass. It seems like, you need to provide two options: HTH. |
Providing absolute paths to both dest/src seems to work. This should be documented $somewhere though :) |
Arrrg, getting this to work was painful. For future reference for those using node-sass from cli: cd public/css && ../../node_modules/.bin/node-sass `pwd`/main.sass --source-comments map --source-map `pwd`/main.css.map -o `pwd`/main.css --watch --output-style compressed && cd ../.. Change to your directory structure accordingly. You must, for live css on chrome to work, cd into the directory with your styles first, in addition to using absolute paths. This is because the source maps url to which the comment in main.css points to is relative to the css directory. There could be another way, but it was surprisingly difficult to find that one. |
only `sourceMap: true` works
Option parsing is still badly broken. You have examples for a thousand frameworks on the readme but your cli doesn't work. $ ls static/
main.sass
$ node_modules/.bin/node-sass -r static/
{
"status": 4,
"message": "File to read not found or unreadable: static/",
"code": 4
}
$ node_modules/.bin/node-sass -w static/main.sass -o static/main.css
Provide a Sass file to render
Example
node-sass --output-style compressed foobar.scss foobar.css
cat foobar.scss | node-sass --output-style compressed > foobar.css |
@spelufo it is because you are not reading the docs carefully.
Possibly.. This is an open source project and the philosophy that follow is: DIY |
I can cat this file at the path normally... but node-sass is not reading from the pipe properly. However, when I cd into the directory and cat the file it works properly. |
@glassimly Where are your imports? in "sass"? If so, node-sass has no way to figure out it should look there - it just receives some bytes on standard input coming out of nowhere... |
@saper Thank you for your response. Isn't using cat with a pipe supposed to send text from standard input into node-sass for compilation? If I cat from within the directory that the file is located it works. Are you saying that node-sass is not reading from standard input?
It just spits compiled css into the terminal. Isn't this how it's supposed to work?
Thanks for helping me to clear up any misunderstanding I might have. |
can you post your files (to gist.github.com or somewhere else convenient)? it is hard to guess what is going on... |
@saper Alright, I made a simple test to reproduce and thereby clarified things. The actual bug/functionality here is that node-sass attempts to process @import relative to the current directory rather than from the directory of the file. https://github.com/glassdimly/sass-bug-test
|
node-sass has no idea where If you really want, you can do this
|
@saper Thank you, that's really helpful, and fixes my problem. Specifically:
|
This commit seems to break the path used in sourceMap generation: fd6a201
We're using
node-sass
andgrunt-sass
for Ghost with the following setup:This however leads to the following error:
The two lines used in
sass.js
generate that path:The text was updated successfully, but these errors were encountered: