You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rsbuild/rspack/css-loader will transform export names to camel case by default when named exports is not on.
so .animateDog and @keyframes animate-dog will share single export name animateDog and the latter overrides the former - that is to say, styles.animateDog refers to the keyframes animate-dog.
How to escape
There's a way to disable the name transform:
import{defineConfig}from"@rsbuild/core";import{pluginReact}from"@rsbuild/plugin-react";exportdefaultdefineConfig({plugins: [pluginReact()],html: {template: "./index.html",},output: {cssModules: {// configure `exportLocalsConvention` to `asIs` to disable the name convertionexportLocalsConvention: 'asIs'}}});
Version
Details
It seems that rsbuild is not extracting css module styles correctly for animations.
I seem to be able to get the animations working if I name styles using kebab-case instead of camelCase
Reproduce link
https://github.com/elliotwestlake/rsbuild-css-modules
Reproduce Steps
pnpm dev
I have included a working example for vite
pnpm dev:vite
The text was updated successfully, but these errors were encountered: