1
現在我有這樣的代碼讓一飲而盡手錶和編譯整個目錄ES6
var gulp = require('gulp');
var babel = require('gulp-babel');
var babelify = require('babelify');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
gulp.task('watch', function() {
gulp.watch('./scripts/es6/*.es6', ['modules'])
});
gulp.task('modules', function() {
browserify({
entries: './scripts/es6/popup.es6',
debug: true
})
.transform(babelify)
.bundle()
.pipe(source('popup.js'))
.pipe(gulp.dest('./scripts'));
});
現在它只是編譯popup.es6當它改變,但我想它來編譯./scripts/es6/
下的任何內容。我知道這是可能的,但你怎麼做?