-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Bundler: Support CSS Modules *.module.css
#16916
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
Comments
Bun 1.2.3 recently also launched support for developing frontend apps using import styles from './App.module.css';
console.log(styles.main); Bun fails with:
|
CSS module support would be great, or at least documenting how we can add it using third party tools frontend dev with bun has gotten 100x better with the support of targeting .html files, this would be the final step towards a production ready solution |
I am currently working on this! |
@zackradisic I see that this issue was closed without supporting |
This doesn't seem to work for me in 1.2.5. This code: import { serve } from 'bun';
import index from './index.html';
const server = serve({
development: process.env.NODE_ENV !== 'production',
routes: {
'/*': index,
},
}); when run, throws:
|
By the way, support SCSS |
We can first utilize the existing ecosystem and come up with feasible solutions, and then optimize them for better results in the future |
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?
The text was updated successfully, but these errors were encountered: