-
Notifications
You must be signed in to change notification settings - Fork 14
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
Support for gulpfile written in ES6 #16
Comments
I agree it would be nice if it would "just work" out of the box, but in the meantime I found a workaround using the nodeCmd option to use babel-node: return gulp.src(path.resolve(__dirname, '../other-project/gulpfile.babel.js'))
.pipe(chug({
// Specify babel-node for ES6 support
nodeCmd: path.resolve(__dirname, 'node_modules/.bin/babel-node.cmd')
}))
.on('error', gutil.log); The .cmd after babel-node is needed on Windows, but you'd want to drop that on any other OS. If you don't have babel-node installed,
should pull it down. |
I came across this issue today and @03eltond workaround did work but it shouldn't be needed. I already have a .babelrc in the directory with the gulp file. I ended up just spawning my own process and it actually worked better and faster than this plugin. import { exec } from 'child_process';
import map from 'map-stream';
function buildModules() {
return gulp.src(['./modules/*/gulpfile.babel.js'])
.pipe(map(function (file, cb) {
exec('gulp --gulpfile ' + file.path, function(error, stdout, stderr) {
console.log(stdout);
cb();
});
}));
}
buildModules.displayName = 'build';
gulp.task(buildModules); May help someone else |
Huh that's clever, thanks for sharing |
Gulp since version 3.9 supports gulpfile written in es6 (babel). It would be great if gulp-chug could support babel. Right now I getting syntax error. Update dependency to new version of gulp didn't help.
The text was updated successfully, but these errors were encountered: