-
We started sharing a number of React components in our SPA as Bit.dev components and ran into an issue: can't use our components on Bit's dashboard due to CSS-modules as Bit's build process does not create them. We use Bit 0.0.687. Use "bit start" to launch Bit dashboard or "bit export" to publish the components to a remote scope, then open a remote dashboard. Our components which use: import style from './style.css' and relay on a CSS module get undefined "style" under Bit. May someone tell, please, if there is a way to alter Bit's build process to generate CSS modules? In our Application's Webpack build we use:
and Webpack 5.x. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You can add another build-step to do post-processing for component's SCSS stuff (see here about build tasks). There may be negative side-effects for this, as a consuming bundler may have CSS in the pre-built assets that could have been deduped... |
Beta Was this translation helpful? Give feedback.
-
So, renaming CSS files to style.module.css solved the issue. |
Beta Was this translation helpful? Give feedback.
So, renaming CSS files to style.module.css solved the issue.