-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow specifying a directory for sourcemaps #216
Conversation
Should be fixed in node-sass, not here. https://github.com/sass/node-sass |
I apologise for digging deeper. You are correct, insofar as it could be be fixed upstream. But the actual problem is introduced by grunt-sass as it adds multiple files functionality to node-sass's one-file per call interface. So I think its definitely legitimate to fix that here. |
👍 Would be great if it was fixed here, in grunt-sass. |
grunt-sass is far from the only node-sass consumer to use it for multiple files, better to fix it in node-sass so everyone benefits from it. |
I doubt it will be fixed there. They seem to be in the opinion the calling party should do as they just did it for their CLI interface (sass/node-sass#903) and didn't add that to the |
I'm sorry, what exactly is the issue? node-sass has mutlifile compilation and sourcemap support. Please present a clear scenario and your expectations. As far as I understand what you're asking for should be possible in node-sass as of sass/node-sass#903. |
This is incorrect. The CLI backs on to our public API. We update the https://github.com/sass/node-sass/pull/964/files#diff-c19ab2481e2703fcf0d2808f4c762f63R190
We could do this, however I suspect it not work as expected. Grunt allows you to gather files from many different sources, so I suspect we'd have issues mirroring the directory semantics in the sourcemaps directory for everyone. @sindresorhus IMO this is a grunt-sass specific issue. Node sass supports compile a single file or an entire directory, and we create sourcemaps for both use cases. Since grunt sass uses grunt's file globbing semantics it needs to correctly set the |
@sindresorhus I just ran into this problem too. It would be great if you would merge this. |
At the moment there doesn't seem to be a way to get the sourcemaps generated in another directory than the source directory when you process multiple files in one target like:
With this patch if the
sourceMap
option ends with/
(or\
) …… it is treated as directory and the sourcemap is named after the destination file with
.map
added.With the example above you would get the following files generated in the end:
Another way to achieve this would have been to add a option like
sourceMapDir
, but I thought this way it won't clash with existing behavior or possible extension of node-sass withsourceMapDir
.