Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add cssModules namedExport test case #854

Merged
merged 3 commits into from
Mar 17, 2025

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).

Sorry, something went wrong.

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.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@SoonIter SoonIter force-pushed the syt/css-module-named-export branch from f458645 to 7cbdc4d Compare March 17, 2025 09:23

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@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.

None yet

2 participants