-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Intercept file loading #279
Comments
I don't believe there is the ability to do that with libsass, node-sass passes |
Ok, thanks. Then I'll ask at libsass 😄 |
At least they're providing a way to query all imported files. This would be useful for several tools that are using node-sass. What do you think? |
Ah I didn't know that was there, would be good to expose that in node-sass. |
A possible api could look like: var stats = {};
sass.render({
data: 'body{background:blue; a{color:black;}}',
stats: stats,
success: function(css){
console.log(css);
console.log(stats);
}
}); var stats = {};
console.log(sass.renderSync({
data: 'body{background:blue; a{color:black;}}',
stats: stats,
outputStyle: 'compressed'
}));
console.log(stats); The passed |
What do you say? |
@jhnns sounds good, would you be up for sending a pull request for this? |
I'll try. Never used a c-binding before 😉 |
Btw: At libsass they're currently discussing an API for this feature #21 |
Is it possible to intercept the file loading process? So if my
main.scss
file containsI'd like to load
grid
by myself and pass the content to sasslib. Less for example provides a way to override afileLoader
-function.I know that node-sass is just a wrapper of libsass. I'm just curious if you know about such an api and if you're providing access to it.
Just for your information: I'm trying to write a sass-loader for webpack which provides loaders and plugins for all kind of "web modules" (html, css, js, less, jade, etc.). webpack needs to know about the dependency tree to work correctly.
The text was updated successfully, but these errors were encountered: