Open blond opened 8 years ago
To build i18n with bem-core need provide code of i18n core to BEMContext.
i18n
bem-core
BEMContext
Example:
const gulp = require('gulp'); const bemhtml = require('gulp-bem-xjst').bemhtml; const I18NCode = readFileSync('path/to/core'); gulp.task('default', function () { return gulp.src('page.bemhtml') .pipe(bemhtml({ context: { i18n: I18NCode } })) .pipe(gulp.dest('dist')); });
This code should add BEM-XJST template to sources:
oninit(function(exports, context) { var BEMContext = exports.BEMContext || context.BEMContext; BEMContext.prototype.i18n = I18NCode; });
To build
i18n
withbem-core
need provide code of i18n core toBEMContext
.Example:
This code should add BEM-XJST template to sources: