Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

node-sass doesn't return POSIX paths, correct? #2393

Closed
npetruzzelli opened this issue May 23, 2018 · 3 comments
Closed

node-sass doesn't return POSIX paths, correct? #2393

npetruzzelli opened this issue May 23, 2018 · 3 comments

Comments

@npetruzzelli
Copy link

This is a general question, which I could not find guidelines for in https://github.com/sass/node-sass/blob/master/.github/CONTRIBUTING.md

My understanding is that source maps only work with URLs (though I have an issue open to confirm this), not file system paths, though I found the following comment in a popular node package

https://github.com/webpack-contrib/sass-loader/blob/2529c0716b1bca321c22d16636b1385682b1c730/lib/loader.js#L90-L94

            // node-sass returns POSIX paths, that's why we need to transform them back to native paths.
            // This fixes an error on windows where the source-map module cannot resolve the source maps.
            // @see https://github.com/webpack-contrib/sass-loader/issues/366#issuecomment-279460722
            result.map.sourceRoot = path.normalize(result.map.sourceRoot);
            result.map.sources = result.map.sources.map(path.normalize);

Can you confirm whether or not this comment is accurate?

@xzyfer
Copy link
Contributor

xzyfer commented May 23, 2018 via email

@xzyfer xzyfer closed this as completed May 23, 2018
@xzyfer
Copy link
Contributor

xzyfer commented May 23, 2018 via email

@npetruzzelli
Copy link
Author

Got it!

I'll ask in the LibSass repo then. I was under the assumption that both the Mozilla node module and LibSass were adhering to the to the same document (Source Map Revision 3 Proposal), but from what you are saying, that may not be the case.

Thank you for your time and for pointing me in the right direction!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants