babel / gulp-babel

Gulp plugin for Babel
https://babeljs.io
MIT License
1.32k stars 120 forks source link

*.js files out of the root directory cannot be compiled #180

Open darrenzo opened 5 years ago

darrenzo commented 5 years ago

gulpfile.js and other files are put in “tools” directory. Now I compile *.js under “builds” directory that is the same level as “tools” directory, but the compilation does not work.

// tools/gulpfile.js

// doesn't work
gulp.task('test', function () {
    gulp.src("../builds/*.js")
        .pipe(babel())
        .pipe(gulp.dest('../builds'));
})

// work
gulp.task('test', function () {
    gulp.src("./*.js")
        .pipe(babel())
        .pipe(gulp.dest('./'));
})