Include loaded URLs in failed compilation result #3830
Labels
enhancement
New feature or request
JS API
About the shared JS API
planned
We would like to add this feature at some point
For the same reasons as described in #3577 , it can be useful to know which files were loaded at the time of a compilation failure. For example, watching those files and recompiling once one of the files are saved.
Currently,
handleCompileResult
wrapsresponse.result.value
into the thrown exception.https://github.com/sass/embedded-host-node/blob/eabbe379fe1224be32a1b8c36d7c0f3ca1913fe2/lib/src/compiler/utils.ts#L220-L221
Based on my understanding of linked issues, loaded files would be available at
response.loadedUrls
, but there is no way to access this value whencatch
-ing the thrown error. If more of the rawresponse
value were included in the exception, it could be possible to access this from acatch
handler.My use-case is a compiler wrapper for
sass-embedded
which includes a "watch" option to recompile on save. When a compilation error occurs, I currently resort to parsing through the Sass stack trace to find the files to watch, but this has proven to be both error-prone and unstable.The text was updated successfully, but these errors were encountered: