Skip to content

bempack/bemdecl-to-fs-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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',
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published