JS API: Add Exception.loadedUrls
Consider these 3 files:
# a.scss
@import './b.scss'
# b.scss
@import './c.scss'
# c.scss
.foo { color: $unknownVariable }
Bundling a.scss would roughly throw this exception:
Exception {
message: 'Undefined variable',
span: { url: new URL('c.scss') },
}
The bundler now knows a.scss (entry file) and c.scss (error.span.url) but b.scss isn't mentioned. So trying to fix the error in b.scss (remove the import or add the variable) woudn't trigger a rebuild.
This could be solved by returning the loadedUrls array on the exception so the bundler can watch all files that have been touched.
I'd do a PR to e.g. modify https://github.com/webpack-contrib/sass-loader/blob/master/src/index.js#L79-L90 to grant webpack the loadedUrls in case of an error.
We have this information in Dart and in the embedded protocol, but we don't currently expose it through the JS API and we should.