Skip to content

Commit

Permalink
dubious fixes (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeti-or authored and awinogradov committed Jun 22, 2017
1 parent d24cc80 commit d25ccf0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = function(source) {

const callback = this.async(),
options = Object.assign({}, this.options.bemLoader, loaderUtils.getOptions(this)),
levelsMap = bemConfig.levelMapSync() || opts.levels,
levelsMap = options.levels || bemConfig.levelMapSync(),
levels = Array.isArray(levelsMap) ? levelsMap : Object.keys(levelsMap),
techs = options.techs || ['js'],
langs = options.langs || ['en'],
Expand Down Expand Up @@ -68,8 +68,8 @@ module.exports = function(source) {
}, [])
// find path for every entity and check it existance
.map(bemCell => {
const localNamingOpts = levelsMap[bemCell.layer].naming || namingOptions;
const fsScheme = levelsMap[bemCell.layer].scheme || 'nested';
const localNamingOpts = (levelsMap[bemCell.layer] && levelsMap[bemCell.layer].naming) || namingOptions;
const fsScheme = (levelsMap[bemCell.layer] && levelsMap[bemCell.layer].scheme) || 'nested';
const entityPath = path.resolve(bemFs(fsScheme).path(bemCell, localNamingOpts));

this.addDependency(entityPath);
Expand Down

0 comments on commit d25ccf0

Please sign in to comment.