-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
52 lines (41 loc) · 1.39 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')
var clean = require('gulp-clean')
var jshint = require('gulp-jshint')
var uglify = require('gulp-uglify')
var notify = require('gulp-notify')
var traceur = require('gulp-traceur')
var es6ModuleTranspiler = require('gulp-es6-module-transpiler')
gulp.task('lint', function() {
return gulp.src('./js/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('uglify', function () {
return gulp.src('./register*.js')
.pipe(uglify())
.pipe(gulp.dest('./out'))
})
gulp.task('traceur', function () {
return gulp.src('./examples/js/classes/*.js')
.pipe(traceur({ sourceMap: true }))
.pipe(gulp.dest('./examples/js/out'))
})
gulp.task('es6modules', function () {
return gulp.src('./examples/js/in/*.js')
.pipe(es6ModuleTranspiler({ type: 'amd' }))
.pipe(gulp.dest('./examples/js/out'))
.pipe(notify('ES6 Modules are ready!'));
})
gulp.task('clean', function () {
return gulp.src('./examples/js/out/*.js', { read: false })
.pipe(clean())
})
gulp.task('watch', function() {
// // Watch .scss files
// gulp.watch('src/styles/**/*.scss', ['styles']);
// Watch .js files
gulp.watch('./examples/js/in/*.js', [ 'clean', 'es6modules' ]);
// // Watch image files
// gulp.watch('src/images/**/*', ['images']);
})
gulp.task('default', [ 'clean', 'traceur' ]);