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

dist: Provide concatenated templates #1855

Closed
tadatuta opened this issue May 25, 2016 · 1 comment
Closed

dist: Provide concatenated templates #1855

tadatuta opened this issue May 25, 2016 · 1 comment
Assignees
Milestone

Comments

@tadatuta
Copy link
Member

Related to bem/bem-components-dist#6

@tadatuta tadatuta added this to the v4.0 milestone May 25, 2016
@tadatuta tadatuta self-assigned this May 25, 2016
@Guria
Copy link
Contributor

Guria commented May 30, 2016

@tadatuta If possible would be great to see them as commonJs or umd module:

module.exports = function (match, once, wrap, block, elem, mode, mod, elemMod, def, tag, attrs, cls, js, bem, mix, content, replace, extend, oninit, xjstOptions, local, applyCtx, applyNext, apply) {
  /* concatenated templates here */
}

So it would be possible to pass it to xjst runtime's compile fn:

const reactXjst = require('react-xjst');
const React = require('react');
const Runtime = require("xjst-vidom");

let vidom = {}
let api = new Runtime({});
api.compile(require('bem-components-dist/desktop/bem-components.bemhtml-templates.js'));
api.exportApply(vidom)

module.exports = reactXjst(vidom, React);

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

2 participants