Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@webpack-blocks/css-modules

andywer280MIT0.4.0

Webpack block for CSS modules.

readme

Webpack blocks - CSS Modules

JavaScript Style Guide NPM Version

This is the css-modules block providing CSS modules configuration by setting the modules parameter on the css-loader.

Usage

const { createConfig } = require('@webpack-blocks/webpack')
const cssModules = require('@webpack-blocks/css-modules')

module.exports = createConfig([
  cssModules(/* options */)
])

Options

exclude (optional)

Regular expression, string or function describing which files/directories not to use the CSS modules loader on. Defaults to /\/node_modules\// regex.

importLoaders (optional integer)

That many loaders after the css-loader are used to import resources. Defaults to 1. See css-loader.

localIdentName (optional string)

The pattern how to rewrite the CSS class names. Defaults to [name]--[local]--[hash:base64:5] in development and [hash:base64:10] in production.

Webpack blocks

Check out the

👉 Main Documentation

Released under the terms of the MIT license.

changelog

@webpack-blocks/css-modules - Changelog

0.4.0

  • Breaking change: Dropped the default node_modules/ exclusion

0.3.0

  • Adapted to new API: Using context now

0.1.1

  • loaders: [ 'style', 'css' ] => loaders: [ 'style-loader', 'css-loader' ]

0.1.0

Initial release.