enb / enb-bem-specs

BEM specs for ENB
Other
14 stars 22 forks source link

Error with merge options in templateEngine.templateOptions #56

Closed pavelpower closed 8 years ago

pavelpower commented 8 years ago

look on this line: https://github.com/enb/enb-bem-specs/blob/master/lib/node-configurator.js#L58

 // setup template engine
    var templateEngineOpts = _.assign({}, templateEngine.templateOptions, {
        target: '?.browser.template.js',
        filesTarget: '?.template.files'
    });

if i will include console for check options


 // setup template engine
    var templateEngineOpts = _.assign({}, templateEngine.templateOptions, {
        target: '?.browser.template.js',
        filesTarget: '?.template.files'
    });

    console.log('templateEngineOpts:', templateEngineOpts);
    console.log('templateEngine.templateOptions:', templateEngine.templateOptions);

and set options

specsBH.configure({
        langs: true,
        destPath: 'bh-set.specs',
        levels: ['blocks'],
        templateEngine: {
            templateTech: require('enb-bh/techs/bh-bundle'),
            templateOptions: {
                devMode: false,
                levelsTarget: '?.levels',
                filesTarget: '?.base.files',
                dirsTarget: '?.base.dirs',
                target: '?.bh.js'
            },
            htmlTech: require('enb-bh/techs/bemjson-to-html'),
            htmlTechOptionNames: {
                bemjsonFile: '?.bemjson.js',
                bhFile: '?.bh.js'
            }
        },
        sourceLevels: [
            { path: '../libs/bem-core/common.blocks', check: false },
            { path: '../libs/bem-pr/spec.blocks', check: false },
            { path: 'blocks', check: true }
        ]
    });

you will see this

templateEngineOpts: { devMode: false,
  levelsTarget: '?.levels',
  filesTarget: '?.template.files',
  dirsTarget: '?.base.dirs',
  target: '?.browser.template.js' }
templateEngine.templateOptions: { devMode: false,
  levelsTarget: '?.levels',
  filesTarget: '?.base.files',
  dirsTarget: '?.base.dirs',
  target: '?.bh.js' }

I not can build BH for only server.

pavelpower commented 8 years ago

yep i used require('enb-bh/techs/bh-commonjs') not require('enb-bh/techs/bh-bundle')