Skip to content
This repository has been archived by the owner on Mar 25, 2018. It is now read-only.

bem-xjst API? #116

Open
nicothin opened this issue Jul 8, 2017 · 1 comment
Open

bem-xjst API? #116

nicothin opened this issue Jul 8, 2017 · 1 comment
Labels

Comments

@nicothin
Copy link

nicothin commented Jul 8, 2017

Tell me please, how can I transfer the settings in bem-xjst?
My gulpfile:

const gulp = require('gulp');
const concat = require('gulp-concat');
const bemxjst = require('gulp-bem-xjst');
const bemhtml = bemxjst.bemhtml;
const bemtree = bemxjst.bemtree;

gulp.task('bemhtml', function() {
  return gulp.src('./blocks/**/*.bemhtml.js')
  .pipe(concat('temp-all.bemhtml.js'))
  .pipe(bemhtml())
  .pipe(gulp.dest('temp/')); // один хрен, будет сохранен в корень проекта. TODO: выяснить почему
});

I tried:

const bemhtml = bemxjst.bemhtml.compile(function() {
    }, {
        naming: {
            mod: '--'
        }
    });

But I'm getting an error in the terminal: TypeError: bemxjst.bemhtml.compile is not a function

@qfox
Copy link
Member

qfox commented Jul 10, 2017

Well, it should be possible to pass opts into the function inside pipe:

  .pipe(bemhtml({ HERE }))

It's the place where we creating transform stream with bemxjst.bemhtml.compile inside.
Here: https://github.com/gulp-bem/gulp-bem-xjst/blob/master/index.js#L49

@qfox qfox added the question label Jul 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants