-
-
Notifications
You must be signed in to change notification settings - Fork 770
Closed
Copy link
Labels
Description
What problem does this feature solve?
The [folder]
template string is supported in css-loader
localIdentName
option, but not supported in rspack native CSS.
Adding support for it would enhance usability.
config: rspack.Configuration = {
module: {
generator: {
"css/auto": {
localIdentName: "[folder]__[local]",
},
},
},
};
// ex: `.root` in `a/b/c/TestRender/index.css` :
// expected: `TestRender__root`
// actual(current): `[folder]__root`
What does the proposed API of configuration look like?
webpack documentation: css-loader | webpack
crates/rspack_plugin_css/src/utils.rs
might be involved.
https://github.com/web-infra-dev/rspack/blob/main/crates/rspack_plugin_css/src/utils.rs
original webpack patch:
feat: added [folder] placeholder
webpack-contrib/css-loader@a0dee4f
This commit includes the javascript implementation and tests.