0

I'm using gulp babel and when I change the path to include a glob, I'm no longer getting an output, but when I have a specific path in , I get an output.

I'm using gulp babel version 8, I have this issue where my gulp task only runs successfully when I provide a full path, the task works fine and it outputs a file to the destination I provided, but this folder contains many files I'd like to use babel on. When I change to use a glob the task just starts but never stops and no file is output, I've tried googling it but it doesn't seem like there's many useful materials on an issue like this

Working gulp task:
gulp.task('transpile-calendar', () =>
gulp.src('javascript/util/dateUtil.js')
.pipe(babel({
    presets: ['@babel/env']
}))
.pipe(gulp.dest('static/js/prod'))
);

Gulp task that does not produce output:
gulp.task('transpile-calendar', () =>
    gulp.src('javascript/util/*.js')
    .pipe(babel({
        presets: ['@babel/env']
     }))
.pipe(gulp.dest('static/js/prod'))
);

Contents of my package.json:
"@babel/core": "^7.4.5",
"@babel/preset-env": "^7.4.5",
"babel-polyfill": "6.26.0",
"browser-sync": "2.26.3",
"gulp": "3.9.1",
"gulp-add-src": "1.0.0",
"gulp-babel": "^8.0.0",
"gulp-clean-css": "3.10.0",
"gulp-compass": "2.1.0",
"gulp-concat": "2.6.1",
"gulp-if": "2.0.2",
"gulp-ng-annotate": "2.1.0",
"gulp-strip-css-comments": "2.0.0",
"gulp-uglify": "3.0.2",
"vue": "2.6.10"

I expect my use of the * to include both the files in the gulp task and produce output in the same file similar to the first one without the use of *.

rb20
  • 129
  • 2
  • 10

1 Answers1

0

I have now resolved my issue. In case anyone comes across this in the future and has the same problem, I had a syntax error in my code.

It is very useful to log out any potential errors in the gulptask by using .on("error", err => console.log(err)) included in your task.

rb20
  • 129
  • 2
  • 10