-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Scss module not in bundle when importing via ?inline #7552
Comments
Reproduction worked by applying the following changes.
https://stackblitz.com/edit/vitejs-vite-6l3rpv?file=src/main.js Since ._root_115gd_1 {
color: red;
} var styles = `._root_115gd_1 {
color: red;
}`;
console.log(styles); Also I feel a bit strange to inline css module files. How do you deal with random string suffixed class names without normally importing them? |
Thanks for fixing it, forgot about renaming the file... So the reason I want to do inline imports is to keep CSS with the actual component. If I don't do that, all the CSS ends up in a single CSS. When building a component library, that is not desirable, as you would have to import all the styles even if you only use a single component from it. Anyways... Even if it's a weird use case, this is not expected behavior. The build chain clearly eliminates that chunk, even if it's used. Regarding random class names: I use |
Thank you for the explanation.
I was trying say that |
Describe the bug
When I import a
<file>.module.scss?inline
in a file to use its content, the file content is just gone when I runvite build
. It#'s there invite dev
however, and I canconsole.log
it.(for some reason, modules don't work with vite.new - I couldn't get it to work there at all).
source code:
compiled code:
expected output:
Reproduction
https://stackblitz.com/edit/vitejs-vite-1vjpzw?file=package.json
System Info
Used Package Manager
pnpm
Logs
Validations
The text was updated successfully, but these errors were encountered: