Skip to content

Module rule with css-loader using CSSStyleSheet #5215

Answered by ShaneYu
ShaneYu asked this question in Q&A
Discussion options

You must be logged in to vote

In the end I gave up trying to configure rsbuild so that I could use import sheet from "./styles.css?sheet". Since CSS and the SASS plugin support ?inline queries, I ended up doing this instead:

import styles from "./styles.scss?inline";

const styleSheet = new CSSStyleSheet();
styleSheet.replaceSync(styles);

This works as I need/want it to, just a shame I have to create the style sheet and sync replace it opposed to just importing a sheet directly.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ShaneYu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant