Webpack loader wrapper for bemdecl-to-fs.
$ npm i bemdecl-to-fs-loader
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',
}