Closed FelipeIzolan closed 3 months ago
Hi @FelipeIzolan thanks for your report. what's the expected behaviour? From your screenshot I can see the "terminal" with a different style
Hi @FelipeIzolan thanks for your report. what's the expected behaviour? From your screenshot I can see the "terminal" with a different style
Hi! So in the dev environment, the css module that i'm importing on line-14 (the second image) is working fine, but when I execute the preview and see the result, the css module that was imported is not being linked.
The expected behavior is to split the CSS files and only load what the page needs, instead of bundling all CSS into a single file.
Example: I'm using Prism to syntax-highlight the <code>
block. Since not every page will have a code block, it's best to only load the necessary CSS.
Hi @FelipeIzolan thanks for the basic reproduction repository.
I tested the your example and in production build ~/prism.module.css
is detected as unused.
In fact, the preview build remove it.
To solve this issue you need to use the css module as explained in the Qwik documentation.
eg.
import styles from '~/prism.module.css';
export default component$(() => {
return (
<>
<h1 class={styles.test}>Hello, World!</h1>
[...]
</>
);
});
CSS file
It works as documented, so I'm closing this issue for now, feel free to re-open it if it's still an issue for you. Thanks
Which component is affected?
Qwik Rollup / Vite plugin
Describe the bug
Reproduction
https://github.com/FelipeIzolan/qwik-issue
Steps to reproduce
No response
System Info
Additional Information
No response