storybookjs / addon-postcss

This Storybook addon can be used to run the PostCSS preprocessor against your stories.
MIT License
20 stars 22 forks source link

feat: Support CSS Modules #30

Open TeoTN opened 3 years ago

TeoTN commented 3 years ago

Issue

Resolves: https://github.com/storybookjs/addon-postcss/issues/29

Description

Added additional rule that handles CSS modules when they have .module.css extension. The rule is mutually exclusive with .css rule. Also using different lifecycle method - webpackFinal instead of webpack. Otherwise, a CSS rule is added implicitly by Storybook afterwards, causing it to parse CSS files twice, and in consequence it'd fail. This implementation replaces that rule.

unpunnyfuns commented 2 years ago

This works as intended for my purposes!

alesma commented 1 year ago

This works well in my case too, i have built your branch and used https://www.npmjs.com/package/patch-package to start using it, but would be good to have this merged

ryanzec commented 1 year ago

Is there a reason this is not being merge, not being able to support css modules seems like a pretty big deal?