-
-
Notifications
You must be signed in to change notification settings - Fork 430
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
Use proper hook for SASS loader. #53
Conversation
97884d2
to
81c07ab
Compare
This changes a lot of stuff and the tests need to be updated to match. This builds a small project I have going right now but I haven't tested it majorly on anything else. Someone should look into it.
👍 |
Sorry for not answering this. First of all: Thank you for work. I appreciate every contribution. Unfortunately this PR looks a bit over-complicated to me. Imho you're using too much internal stuff which can then break easily when @sokra changes something. We can take the less-loader as blueprint since it already has this feature for quite some time. The important code is here. We can let webpack/enhanced-resolve do the resolving by calling // loaderContext is `this` inside the loader
loaderContext.resolve(context, moduleRequest, cb) Take also a look at the loader api. I'll publish a branch which contains the refactoring for node-sass@2.0.0 |
@jhnns A lot of this was indeed lifted from @import "foo!/something"; The above is otherwise not possible. Also, If you don't want to merge this please close the branch and I'll maintain a fork myself, as I need the module loading capability. |
Oh, ok... didn't know that you already tried the @izaakschroeder what do you mean by "module urls"? Inlined loaders? I don't know what you mean by "root directory", but the described behavior should be done with |
@jhnns the module loader allows you to do stupid things like How do you specify multiple paths to be searched? This approach allows you to feed the resolver multiple base paths and it will go through them in order, since SASS convention has no concept of |
Check out this chapter of loader-utils. The |
I've implemented the custom importer with the less-loader approach. Anyway, thanks for your suggestions 👍 |
This changes a lot of stuff and the tests need to be updated to match. This builds a small project I have going right now but I haven't tested it majorly on anything else. Someone should look into it.