Skip to content
Discussion options

You must be logged in to vote

In this case, you may need to customize module rules. By default, ?inline query syntax will use css-loader by default to generate runtime-related code. Run DEBUG=rsbuild rslib build to see the normalized Rspack config.

You can modify the default css-inline module rules with bunder chain.

e.g.

tools: {
  bundlerChain: (chain, { CHAIN_ID }) => {
    const rule = chain.module.rules.get(CHAIN_ID.RULE.CSS_INLINE);
    if (rule) {
      // remove css-loader
      rule.uses.delete(CHAIN_ID.USE.CSS);
      rule.type("asset/source");
    }
  },
},

Replies: 1 comment

Comment options

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