bemdecl-to-fs-loader

0.0.4 • Public • Published

bemdecl-to-fs-loader

Webpack loader wrapper for bemdecl-to-fs.

Installation

$ npm i bemdecl-to-fs-loader

Usage

Loader accepts javascript data, like array or plain object, or raw module code as a string (module.exports = [...]).

module.exports = {
  /* entry, output */
 
  module: {
    loaders: [
      {
        test: /\.bemjson\.js$/i,
        loader: 'bemdecl-to-fs!bemjson',
      }
    ]
  },
 
  bem: {
    levels: [
      'libs/blocks'
    ],
    extensions: [
      'css'
    ],
  }
};

Note that you can provide extensions and levels arguments to the loader, so they will overwrite globals from the bem section. For example:

{
  test: /\.bemjson\.js$/i,
  loader: 'bemdecl-to-fs?extensions[]=css&levels[]=libs/blocks!bemjson',
}

/bemdecl-to-fs-loader/

    Package Sidebar

    Install

    npm i bemdecl-to-fs-loader

    Weekly Downloads

    3

    Version

    0.0.4

    License

    MIT

    Last publish

    Collaborators

    • yeti-or
    • just-boris
    • sullenor