enb / enb-bem-techs

ENB package to build BEM-projects
Other
22 stars 22 forks source link

Build fails if there is `constructor` block #189

Closed blond closed 6 years ago

blond commented 8 years ago

Problem in levels tech: constructor it's a reserved word in JavaScript.

Level store introspection in hash where keys are block names.

Error:

16:33:22.483 - build started
16:33:22.510 - [rebuild] [src/static/bundle/bundle.bemdecl.js] file-provider
[Function: Object] 'files' { name: 'constructor.css',
  fullname: '/Users/h4/Projects/retroblock.ru/src/static/common.blocks/constructor/constructor.css',
  suffix: 'css',
  mtime: 1450648349000,
  isDirectory: false }
16:33:22.518 - [failed] [src/static/bundle/bundle.levels] levels
16:33:22.519 - [failed] [src/static/bundle/bundle.files] files
16:33:22.519 - [failed] [src/static/bundle/bundle.deps.js] deps
16:33:22.520 - [failed] [src/static/bundle/bundle.css] css
16:33:22.520 - [failed] [src/static/bundle/bundle.browser.js] browser-js
16:33:22.520 - build failed
TypeError: Cannot read property 'push' of undefined
    at module.exports.inherit._processFile (/Users/h4/Projects/retroblock.ru/node_modules/enb-bem-techs/lib/levels/level.js:138:47)
    at /Users/h4/Projects/retroblock.ru/node_modules/enb-bem-techs/lib/levels/level.js:191:23
    at Array.forEach (native)
    at module.exports.inherit._loadElement (/Users/h4/Projects/retroblock.ru/node_modules/enb-bem-techs/lib/levels/level.js:177:53)
    at /Users/h4/Projects/retroblock.ru/node_modules/enb-bem-techs/lib/levels/level.js:220:27
    at Array.forEach (native)
    at module.exports.inherit.load (/Users/h4/Projects/retroblock.ru/node_modules/enb-bem-techs/lib/levels/level.js:217:52)
    at /Users/h4/Projects/retroblock.ru/node_modules/enb-bem-techs/techs/levels.js:112:38
    at Array.map (native)
    at /Users/h4/Projects/retroblock.ru/node_modules/enb-bem-techs/techs/levels.js:111:42
blond commented 8 years ago

/cc @h4

blond commented 6 years ago

Fixed in #271