-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
50 lines (44 loc) · 1.16 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
/**
* Directories
*/
var
_public = './public/',
_assets = _public + 'assets/',
_js = _assets + 'js/',
_vendor = _assets + 'vendor/',
_app = _public + 'app/';
/**
* Node modules
*/
var
gulp = require('gulp'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
browserify = require('browserify'),
source = require('vinyl-source-stream');
gulp.task('bundle-app', function() {
return browserify(_app + 'build.js')
.bundle()
.pipe(source('build.js'))
.pipe(gulp.dest(_js));
});
gulp.task('concat-libs', function() {
return gulp.src([
_vendor + 'jquery/dist/jquery.js',
_vendor + 'jquery-ui/ui/jquery-ui.js',
_vendor + 'bootstrap/dist/js/bootstrap.js',
_vendor + 'angular/angular.js',
_vendor + 'angular-ui-router/release/angular-ui-router.js',
_vendor + 'angular-ui-calendar/src/calendar.js',
_vendor + 'fullcalendar/fullcalendar.js',
_vendor + 'fullcalendar/gcal.js'
])
.pipe(concat('libs.js'))
.pipe(gulp.dest(_js));
});
gulp.task('default', function() {
gulp.run('concat-libs');
gulp.run('bundle-app');
gulp.watch(_app + '**/*.js', ['bundle-app']);
gulp.watch(_vendor + '**/*.js', ['concat-libs']);
});