-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (26 loc) · 896 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
31
32
33
34
35
'use strict';
var gulp = require('gulp');
var watch = require('gulp-watch');
var babel = require('gulp-babel');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var config = {
srcJs: ['./src/js/*.js', './src/js/controllers/*.js', './src/js/services/*.js', './src/js/factories/*.js'],
vendorJs: ['./src/js/vendor/angular.js', './src/js/vendor/angular-ui-router.js', './src/js/vendor/angular-local-storage.js'],
};
gulp.task('js', function() {
gulp.src(config.srcJs)
.pipe(babel({
presets: ['es2015']
}))
.pipe(concat('app.js'))
.pipe(gulp.dest('./lib/js'));
gulp.src(config.vendorJs)
.pipe(uglify())
.pipe(concat('vendor.min.js'))
.pipe(gulp.dest('./lib/js/vendor'));
});
gulp.task('watch', function() {
gulp.watch(config.srcJs, ['js']);
});
gulp.task('default', ['watch']);