-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
32 lines (27 loc) · 1.02 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
var gulp = require('gulp'),
babel = require("gulp-babel"),
concat = require('gulp-concat'),
clean = require('gulp-clean'),
uglify = require('gulp-uglify');
gulp.task('clean', function () {
return gulp.src('src/MainBundle/Resources/public/js/compiled', {read: false})
.pipe(clean());
});
gulp.task('babel', ['clean'], function () {
return gulp.src(["src/MainBundle/Resources/public/js/angular/app.js", "src/MainBundle/Resources/public/js/angular/**/*.js"])
.pipe(babel())
.pipe(gulp.dest("src/MainBundle/Resources/public/js/compiled"));
});
gulp.task('merge', ['babel'], function () {
return gulp.src([
'src/MainBundle/Resources/public/js/compiled/**/*.js'
])
.pipe(concat('angular-compiled.js'))
.pipe(gulp.dest('web/js/compiled'));
});
gulp.task('compress', ['merge'], function () {
return gulp.src('web/js/compiled/angular-compiled.js')
.pipe(uglify())
.pipe(gulp.dest('web/js/compiled'));
});
gulp.task("default", ['merge']);