-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Is it possible to update stats.includedFiles in case of compilation error ? #528
Comments
I've added |
It's not node-sass related so no, probably doesn't belong here. |
@akiran, this feature request belongs to libsass. Node-sass is just a wrapper around libsass. I think it might not be possible in all cases from AST point of view, because if the error occurs during the initial parse, the AST will throw and the sass-context (which collects all such information) would be empty. So in the situation, when the initial parse passes, I/O ops succeeded, import-chain is traversed and the compiler errors are collected by context, it might be able to return the desired |
For the described use-case I think it's important to have all the included files until the syntax error occurred and that should be possible in any case. |
In case of watcher tools, compilation temporarily enters error state while typing code and reverts back to success state after completion of statement As @jhnns mentioned, it is useful to provide the available included files. |
As of now, stats.includedFiles are updated only if compilation is successful and it is empty if compilation fails.
This is required in watcher tools built on top of node-sass.
In sass-loader for webpack, stats.includedFiles is used to track dependencies.
webpack-dev-server (watcher) is not working because stats.includedFiles is empty in case of error .
So, we had to use external packages like sass-graph, just to parse dependencies which is causing some issues ( webpack-contrib/sass-loader#29 ).
This problem can be solved if stats.includedFiles is updated even in case of errors.
The text was updated successfully, but these errors were encountered: