Closed lin-hun closed 9 years ago
Can you format the code and use code blocks?
var coffee, coffeeSrc, coffeeWatch, concat, directory, exec, gulp, plugins, watch;
gulp = require('gulp');
plugins = (require('gulp-load-plugins'))();
directory = 'lib-coffee/';
coffeeSrc = [directory + 'settings.coffee', directory + 'utility.coffee', directory + 'player.coffee', directory + 'main.coffee'];
concat = plugins.concat;
coffee = plugins.coffee;
watch = plugins.watch;
coffeeWatch = function () {
return gulp.src(coffeeSrc).pipe(concat('main.js')).pipe(gulp.dest('bin/')).on('error', function (err) {
return console.log(err);
});
};
gulp.task('coffeeWatch', coffeeWatch);
gulp.task('watch', function () {
return gulp.watch('lib-coffee/*.coffee', ['coffeeWatch']);
});
var coffee, coffeeSrc, coffeeWatch, concat, directory, exec, gulp, plugins, watch;
gulp = require('gulp');
plugins = (require('gulp-load-plugins'))();
exec = require('child_process').exec;
directory = 'lib-coffee/';
coffeeSrc = [directory + 'settings.coffee', directory + 'utility.coffee', directory + 'player.coffee', directory + 'main.coffee'];
concat = plugins.concat;
coffee = plugins.coffee;
watch = plugins.watch;
coffeeWatch = function() { return gulp.src(coffeeSrc).pipe(concat('main.js')).pipe(gulp.dest('bin/')).on('error', function(err) { return console.log(err); }); };
gulp.task('coffeeWatch', coffeeWatch);
gulp.task('watch', function() { return gulp.watch('lib-coffee/*.coffee', ['coffeeWatch']); });
my code only concat when the watch task init run why ?may the code is wrong?