-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
mark and resolve dependencies #2
Comments
Does |
Is this currently being worked on or is it blocked by something? |
I've made some investigation and it seems like libsass (which node-sass is based on) is not providing a way to intercept the loading of files. This means that we can't resolve files by webpack's algorithm. At least libsass is exposing an array of all imported files which can be marked as dependency. Unfortunately node-sass isn't exposing this yet. |
Thanks @jhnns. So what does that mean practically for sass-loader? It would probably be nice to add a caveat to the documentation for this loader until something changes with libsass. |
Exactly. You can raise your voice here, maybe they'll implement it.
The watch-mode won't work for sass-modules since webpack doesn't know about the dependencies. If node-sass exposed the array of all imported files, at least this could be fixed. Until then a third-party watcher which simply watches all
Yep 👍 . Creating a pull-request of the readme is very easy on GitHub. Just click the edit-button 😄 |
Cool! |
Btw: I'm currently working on this at node-sass. You can watch the progress there. |
@jhnns, awesome! |
|
😄 yeah |
ok! i'll take a look at it tomorrow! Hope i got some time left to add this... |
It seems like there is an issue on macs... |
Hm, i cant get your clone to work either on my Ubuntu laptop....
|
Have you initialized the submodule
|
Yes that must be it. I only took a small look at it :-). I can try fix the issue, or give you some debug data, on my Mac at the office today. |
I see that the issue is solved, could you give me a message when it is released? |
Yup! |
It got released today can we get this in. |
i'm on it! |
Released as 0.2.0, and on npm! |
Nice! 👍 |
Awesome! |
I think the readme needs to be updated to represent this update? Also, one other question, How does this handle imports if the same file is "imported" twice? Does it only include it once? |
I'm having problems with the loader when the build fails from an error in an import. When the imported file is saved (and the compile error is fixed) it won't build unless you save the main file (with all the imports). Something with the files not being resolved and just marking them as dependencies not being enough? |
@sokra ? |
Given this sass file: @import "Thing";
@import "OtherThing"; I import this css using the css-loader as I want it packaged up into my js file. var css = require('css!sass!file-above'); Should the sass-loader take each of those imports and create another module that the parent module should reference? It doesn't do this and creates a string, I have lots of components imported more than once. module.exports = "css{}" + __webpack_require__('Thing') + __webpack_require__('OtherThing'); How would I get sass-loader to do that? Is it possible? |
@ryanseddon This is one of the reasons I have started using rework & rework-npm instead of Sass. |
@ryanseddon This kind of modularity is currently not possible with any CSS preprocessor (LESS and SASS), because each compilation is self-contained and doesn't know about previous compilations. That's why every However, LESS provides a way to import other LESS files without including the source which works quite well. |
So is this issue fixed? I can't use @import from my node_modules folder.
Also tried with the ~ at the start of the @import path. Thanks. |
as mentioned previously, if this issue is fixed, shouldn't the readme be updated to reflect that all is well now? |
Yep #22 😀 |
Looks like the issue the README references has been merged into the main line branch. |
webpack/webpack#157
The text was updated successfully, but these errors were encountered: