-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
39 lines (33 loc) · 1.08 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var gulp = require('gulp');
var coffee = require('gulp-coffee');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var browserify = require('gulp-browserify');
var rename = require('gulp-rename');
var paths = {
scripts: ['app/components/**/*.coffee',]
};
// gulp.task('scripts', function() {
// // Minify and copy all JavaScript (except vendor scripts)
// return gulp.src(paths.scripts)
// .pipe(coffee({bare: true}))
// .pipe(concat('all.js'))
// .pipe(gulp.dest('build/js'));
// });
gulp.task('coffee', function() {
gulp.src('app/components/examples/index.coffee', { read: false })
.pipe(browserify({
transform: ['coffeeify', 'reactify'],
extensions: ['.coffee']
}))
.pipe(rename('all.js'))
.pipe(gulp.dest('./build/js'))
});
// Rerun the task when a file changes
gulp.task('watch', function() {
gulp.watch(paths.scripts, ['coffee']);
gulp.watch(paths.images, ['images']);
});
// The default task (called when you run `gulp` from cli)
gulp.task('default', ['coffee', 'watch']);