Skip to content

Bundler: Support CSS Modules *.module.css #16916

Closed
@nicksrandall

Description

@nicksrandall

What is the problem this feature would solve?

I love Bun's ethos to be a one-stop-shop for all developer/tooling needs. I'd like to use Bun's Bundler to bundle reusable components. While Bun's Bundler has support for bundling CSS, the lack of CSS Modules support make it much harder to share (or embed) these components because of the likelihood that the styles (CSS) could clash with other styles on the page.

What is the feature you are proposing to solve the problem?

CSS Modules is a simple, yet extremely useful tool that automatically hashes your css selectors so that they will not collide with other styles (from other sources) on your page and then provides those hashed names for you in the form on a javascript import so that the ergonomics remain. This is essential for may use-cases involving the re-use styles (or components) across apps.

More info: https://github.com/css-modules/css-modules

Notes

What alternatives have you considered?

  • A bun-lightningcss plugin would probably work -- similar to bun's tailwind support.

Metadata

Metadata

Assignees

Labels

bundlerSomething to do with the bundlercssCSS parser, bundler-relatedenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions