Skip to content

Conversation

@SoonIter
Copy link
Member

@SoonIter SoonIter commented Mar 17, 2025

Summary

best practice for css-modules-named-export

maybe need documented

  1. install "@rsbuild/plugin-typed-css-modules"

  2. "@rsbuild/plugin-typed-css-modules" and output.cssModules

import { pluginTypedCSSModules } from "@rsbuild/plugin-typed-css-modules";
defineConfig({
  output: {
    target: 'web',
    cssModules: {
      namedExport: true,
      exportLocalsConvention: 'camelCaseOnly',
    },
    plugins: [
      pluginTypedCSSModules()
    ]
  },
})
  1. .gitignore
# ignore typed css module
*.scss.d.ts

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link

netlify bot commented Mar 17, 2025

Deploy Preview for rslib ready!

Name Link
🔨 Latest commit 96c6b92
🔍 Latest deploy log https://app.netlify.com/sites/rslib/deploys/67d7eaa34813890008b56e44
😎 Deploy Preview https://deploy-preview-854--rslib.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@SoonIter SoonIter force-pushed the syt/css-module-named-export branch from f458645 to 7cbdc4d Compare March 17, 2025 09:23
@SoonIter SoonIter changed the title test: add cssModules namedExport example test: add cssModules namedExport test case Mar 17, 2025
@SoonIter
Copy link
Member Author

@Timeless0911
TODO: should be documented at the appropriated place

@SoonIter SoonIter merged commit b45f124 into main Mar 17, 2025
15 checks passed
@SoonIter SoonIter deleted the syt/css-module-named-export branch March 17, 2025 09:47
@Timeless0911 Timeless0911 mentioned this pull request Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants