webpack-bem-plugin

0.1.0 • Public • Published

Webpack BEM plugin

Simple steps to use BEM in your React project:

  1. Write components as bem-react-core declarations
  2. Use bem-import-notation to import or require components
  3. Define project structure in bemrc config file
  4. Build project using webpack and Webpack-BEM-plugin
  5. Enjoy 😉

Examples

npm run build-examples

Each example has its public/*.html.

  • Char table (source) js no-sets no-babel
  • Few components (source) js/css sets babel
  • Promo (source) js/css sets library plugins babel

Plugin options

Name Type Description
[techs] {String[]} List of techs in project to build. Default is ['js']
[techMap] {Object} Maps techs to actual file extensions. Tech with no mapping treated as file extension as is. Example of custom mapping: { js: 'react.js' }
[libs] {Object} Stores inline bemrc configurations for some libraries. Use when a library has not its bemrc file and adding it in library codebase is complicated
[plugins] {Function} Callback returns 3rd party plugins with no "child-compiler" support. Example is extract-text-webpack-plugin

Run tests

npm test

Known issues

License

Code and documentation copyright 2018 YANDEX LLC. Code released under the Mozilla Public License 2.0.

Readme

Keywords

Package Sidebar

Install

npm i webpack-bem-plugin

Weekly Downloads

4

Version

0.1.0

License

MPL-2.0

Unpacked Size

121 kB

Total Files

88

Last publish

Collaborators

  • vittly