Start sharing components as a team!Share components as a team!Join Bit to build your applications faster.Get Started Free

webpack-css-modules

v4.0.1arrow_drop_down
v4.0.1
v0.0.8
v0.0.7
v0.0.6
v0.0.5
v0.0.4
v0.0.3
v0.0.2
v0.0.1
STATUS
Passing
DOWNLOADS
1,828
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
A year ago
SIZE
N/A
Bit Webpack CSS modules compiler. Compiles and bundles components with CSS modules using webpack.
3 contributors
Install webpack-css-modules as a package?
Copied
npm i @bit/bit.envs.bundlers.webpack-css-modules
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
modifieddraft
chevron_left
chevron_right

Webpack bundler

A component compiler that bundles the component using webpack ^v4.0.1.

Please note that while bundling components is possible, it is recommended to transpiling components

What is bundled?

The bundler bundles the component’s main file and test files. In case there are component files that are not in those files’ dependency trees, they won’t be bundled. Note that this is in accordance with webpack’s usual behavior, but not in accordance with the usual behavior of Bit compilers, which usually compile all the files.

How to use?

Import the environment.

bit import bit.envs/bundlers/webpack-css-modules -c

Then build using bit build.

bit build

What’s inside

  • js/jsx compiling using the following babel presets babelPresetReact, babelPresetEs2015, stage0
  • [s]css support using style-loader and css-loader
  • css modules
  • mp4|webm|wav|mp3|m4a|aac|oga support using url-loader
  • svg support using svg-inline-loader

Reconfiguring this environment

In case the configuration presets in the webpack.config.js file of this component are not well suited to your needs, follow these steps to modify it.

Got any issues or questions?

Collaboration on this Bit environment happens in this repository. Please open an issue or submit pull request there.