-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
30 lines (26 loc) · 833 Bytes
/
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
var gulp = require('gulp');
var babel = require('gulp-babel');
var sourcemaps = require('gulp-sourcemaps');
var distDir = 'lib/';
var srcFiles = 'src/**/*.es6';
/**
* Default task
* use befor:
* npm install --save-dev babel-plugin-angular2-annotations
* npm install --save-dev babel-plugin-transform-decorators-legacy babel-plugin-transform-class-properties babel-plugin-transform-flow-strip-types babel-preset-es2015
* npm install babel-plugin-transform-es2015-modules-commonjs
*/
gulp.task('default', ['babel']);
/**
* Babel transpile source
*/
gulp.task('babel', function(){
return gulp.src(srcFiles)
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(distDir));
});
gulp.task('babel:watch', function(){
return gulp.watch(srcFiles, ['babel']);
});