Experience-Monks/brfs-babel

Combine with babelify?

rico345100 opened this issue · 1 comments

Hey, I'm using gulp + browserify + babelify combo, and when I tried below code with this module:

gulp.task('build', () => {
    return browserify({
        entries: ['./src/app.js'],
        paths: ['./node_modules'],
    })
    .transform(babelify, { 
        presets: ["es2015"],
    })
    .transform('brfs-babel')
    .bundle()
    .on('error', swallowError)
    .pipe(source('app.js'))
    .pipe(buffer())
    .pipe(gulp.dest(`./build`));
});

It won't worked, so I removed babelify, it worked. But I want to use babelify because most of time, I uses lots of plugins or extra presets like ES7 supports or JSX like something. I really interested in this module(man, load files directly when writing client side code? awesome!), but this wasn't enough to use to me. "brfs" module won't friendly with ES6 module syntax, you know, and that's why you built this. I really don't wanna use CommonJS style into my ES2015 modular code.

So, is there a way to combine this module with babelify? Or if it is possible to some kind of option to add this module into babelify, please tell me how to do. Thanks!

@rico345100 Simply apply this transform before babelify