@bem/sdk.config — levelsSync()
const config = require("@bem/sdk.config")();
const mockfs = require('mock-fs');
const { stripIndent } = require('common-tags');
mockfs({
'.bemrc': stripIndent`
module.exports = {
'root': true,
'levels': [
{ 'layer': 'common', 'data': 1 },
{ 'layer': 'desktop', 'data': 2 },
{ 'layer': 'touch', 'path': 'custom-path', 'data': 3 },
{ 'layer': 'touch-phone', 'data': 4 },
{ 'layer': 'touch-pad', 'data': 5 }
],
'sets': {
'desktop': 'common desktop',
'touch-phone': 'common desktop@ touch touch-phone',
'touch-pad': 'common touch touch-pad'
}
}`
});
const desktopSet = config.levelsSync('desktop');
desktopSet;
no comments