Home  >  Q&A  >  body text

javascript - gulp watch执行任务了日志显示执行任务了,但是目标文件夹内文件未改变

/**
 * Created by lisheng on 15/6/21.
 */

var gulp = require('gulp');
var babel = require('gulp-babel');

gulp.task('babel', function () {
    return gulp.src('index.js')
        .pipe(babel())
        .pipe(gulp.dest('dist'));
});


gulp.task('watch', function() {
    gulp.watch('index.js', ['babel']);

});

这是我的配置文件。手动触发 gulp babel是可以的

天蓬老师天蓬老师2720 days ago400

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-10 15:26:49

    https://github.com/babel/gulp-babel 看看官方的例子和你的有什么不同

    reply
    0
  • Cancelreply