egoist / egoist/rollup-plugin-postcss

Add option to disable bundling / concatination of css

Open
#286 1 comment 10 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
689
Forks
210
PR merge metrics
No merged PRs in 30d

Description

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 = () => (

Button
);
```

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"
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.