CSS default import warning appears for pre-bundled dependencies even if the import is unused #12304
Closed
7 tasks done
Labels
feat: css
feat: deps optimizer
Esbuild Dependencies Optimization
p3-minor-bug
An edge case that only affects very specific usage (priority)
Describe the bug
#11094 added a warning for importing the default export of a CSS file.
Then, #11121 disabled this warning when the default import of a CSS file is not used.
However, the warning still exists for pre-bundled dependencies where the default import is not used.
Reproduction
https://stackblitz.com/edit/vitejs-vite-juhqxl?file=main.js
Steps to reproduce
Look at this line in the vott-ct package: https://github.com/microsoft/CanvasTools-for-VOTT/blob/master/src/canvastools/ts/ct.ts#L86
The transpiled code in the npm package looks like this:
require("./../css/canvastools.css");
Then, the dependency pre-bundling step (optimizeDeps) translates it to the following block:
Then, when importing from vott-ct, we see the following warnings in dev mode:
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: