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

Add option to disable bundling / concatination of css #286

Open
raix opened this issue Jun 11, 2020 · 1 comment
Open

Add option to disable bundling / concatination of css #286

raix opened this issue Jun 11, 2020 · 1 comment

Comments

@raix
Copy link

raix commented Jun 11, 2020

When building a ui component library it's less than ideal to have all the css bundled into one file eg. if the user only includes a "button" it should only include the styles required for that component.

Instead of inlining the css module json output we could create a js file to import instead and have the json file require the generated css file.

This issue is about keeping a 1:1 mapping of the css/scss files doing the transformation without the bundling.

Input
Button.tsx

import React from "react";
import styles from "button.module.scss";

export const Button = () => (<div className={styles.buttonContainer}>Button</div>);

Output
Button.js

import React__default from "react";
import styles from "button.module.scss.js";

export function Button() {
   return (React__default.createElement("div" ......);
}

button.module.scss.js

import "button.module.scss.css";
export default {
    buttonContainer: "Button-module_buttonContainer__1qmSr"
}
@BPScott
Copy link

BPScott commented Aug 3, 2020

This would be super handy for me too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants