Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dysfunction with build template if need block create in html before initialize JS #57

Open
pavelpower opened this issue May 30, 2016 · 0 comments

Comments

@pavelpower
Copy link

pavelpower commented May 30, 2016

https://ru.bem.info/forum/1018/

What i mean?

if i wanna create block in HTML before initialization js with library bem-pr. I will change block spec-content.

specs.configure({
    langs: false,
    destPath: 'specs',
    levels: layers,
    templateEngine: {
        templateTech: require('enb-bh/techs/bh-bundle'),
        templateOptions: {
            devMode: false
        },
        htmlTech: require('enb-bh/techs/bemjson-to-html'),
        htmlTechOptionNames: { bemjsonFile: 'bemjsonFile', templateFile: 'bhFile' }
    },
    sourceLevels: [
        { path: 'libs/bem-pr/spec.blocks', check: false }
    ].concat(layers),

    jsSuffixes: ['js'],
    specSuffixes: ['spec.js']
});

sample block b-legend

module.exports = function(bh) {
    bh.match('spec-content', function () {
        return {block: 'b-legend'};
    });
};

But, then enb-bem-spec not will add my block to the output bemdecl's file for build html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant