docs(diagnostic): add loader experimental diagnostic API#10287
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
|
||
| ``` | ||
| ERROR in ./some-file.js | ||
| (./with-file.js!) 1:1-4 |
There was a problem hiding this comment.
Why are both some-file.js and with-file.js printed in this example, can you explain the relationship between them?
There was a problem hiding this comment.
./some-file.js is a custom filename, ./with-file.js! is the module identifier in which the loader has been processed and emitted an error. This maybe useful for those loaders who bundles a few files and is still willing to print diagnostic for some certain files.
There was a problem hiding this comment.
Ok, with-file is a bit confusing, maybe we can use current-file.js or original-file.js instead.
There was a problem hiding this comment.
I will change with-file to loader.js as this is the filename of the loader.
There was a problem hiding this comment.
I used inline loader for the test. Check this out.
There was a problem hiding this comment.
Try !./loader.js! instead please. You may take these test cases as the reference https://github.com/web-infra-dev/rspack/blob/0befe4435a6502070a431234a29023c80f3de455/packages/rspack-test-tools/tests/diagnosticsCases/module-build-failed/loader-emit-diagnostic/index.js.
Co-authored-by: neverland <chenjiahan.jait@bytedance.com>
Co-authored-by: neverland <chenjiahan.jait@bytedance.com>
Co-authored-by: neverland <chenjiahan.jait@bytedance.com>
Co-authored-by: neverland <chenjiahan.jait@bytedance.com>
Co-authored-by: neverland <chenjiahan.jait@bytedance.com>
Co-authored-by: neverland <chenjiahan.jait@bytedance.com>


Summary
closes #10065
Checklist