-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
52 lines (43 loc) · 1.27 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
50
51
52
var gulp = require('gulp'),
traceur = require('gulp-traceur'),
connect = require("gulp-connect"),
bower = require('main-bower-files'),
clean = require("gulp-clean");
var lib_dir = "public/js/lib";
gulp.task("clean", function() {
return gulp.src("public/js/**/*", {read: false})
.pipe(clean());
});
gulp.task('connect', ["build"],function(){
connect.server({
root: ['public/'],
port: 8000,
livereload: true
});
});
gulp.task('bower', function() {
return gulp.src(bower())
.pipe(gulp.dest(lib_dir));
});
gulp.task("traceur-runtime", function() {
return gulp.src(["node_modules/gulp-traceur/node_modules/traceur/bin/traceur-runtime.js"])
.pipe(gulp.dest(lib_dir));
});
gulp.task('traceur', ["libs"], function () {
return gulp.src(['src/*.js'])
.pipe(traceur({
sourceMap: true,
experimental: true,
modules: "amd",
"traceur.RUNTIME_PATH": "traceur-runtime.js"
}))
.pipe(gulp.dest('public/js'))
.pipe(connect.reload());
});
gulp.task("libs", ["traceur-runtime", "bower"], function() {
});
gulp.task("build", ["traceur"], function() {
});
gulp.task("default", ["connect"], function() {
gulp.watch("src/**/*.js", ["build"]);
});