-
Notifications
You must be signed in to change notification settings - Fork 15
/
gulpfile.js
49 lines (38 loc) · 1.03 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
40
41
42
43
44
45
46
47
48
49
var gulp = require('gulp');
var pipe = require('pipe/gulp');
var connect = require('gulp-connect');
var path = {
src: './src/**/*.js',
// we have to skip example/node (because of the cyclic symlink)
examples: './example/!(node)/**/*.js'
};
// TRANSPILE ES6
gulp.task('build_source_amd', function() {
gulp.src(path.src)
.pipe(pipe.traceur())
.pipe(gulp.dest('dist/amd'));
});
gulp.task('build_source_cjs', function() {
gulp.src(path.src)
.pipe(pipe.traceur({modules: 'commonjs'}))
.pipe(gulp.dest('dist/cjs'));
});
gulp.task('build_examples', function() {
gulp.src(path.examples)
.pipe(pipe.traceur())
.pipe(gulp.dest('compiled/example'));
});
gulp.task('build_dist', ['build_source_cjs', 'build_source_amd']);
gulp.task('build', ['build_dist', 'build_examples']);
// WATCH FILES FOR CHANGES
gulp.task('watch', function() {
gulp.watch(path.src, ['build']);
});
// WEB SERVER
gulp.task('serve', connect.server({
root: __dirname,
port: 8000,
open: {
browser: 'Google Chrome'
}
}));