-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
37 lines (30 loc) · 1.04 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
var gulp = require('gulp'),
browserSync = require('browser-sync').create(),
size = require('gulp-size'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename');
// Servidor estático.
// Crea un servidor local y efectúa un Livereload
// cuando ocurren cambios dentro de directorio 'src'.
gulp.task('browser-sync', function() {
browserSync.init({
server: {
baseDir: "./src"
}
});
gulp.watch(['./src/**/*'], browserSync.reload);
});
// Js Bundle
gulp.task('bundleJS', function () {
gulp.src('./node_modules/angular/angular.js')
.pipe(uglify())
.pipe(size({gzip: true, showFiles: true}))
.pipe(rename('angular.min.js'))
.pipe(gulp.dest('./src/js'));
gulp.src('./node_modules/angular-ui-router/release/angular-ui-router.js')
.pipe(uglify())
.pipe(size({gzip: true, showFiles: true}))
.pipe(rename('angular-ui-router.min.js'))
.pipe(gulp.dest('./src/js'));
});
gulp.task('default', ['browser-sync', 'bundleJS']);