-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSS default import warning appears for pre-bundled dependencies even if the import is unused #12304
Comments
Start a new pull request in StackBlitz Codeflow. |
I think this works as expected cause In the meantime, directly importing unused default CSS shouldn't show this warning. @sapphi-red |
Yes, I understand that the warning is shown because of |
Thanks a lot, @sun0day and @sapphi-red! |
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:/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: