-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
35 lines (31 loc) · 901 Bytes
/
gulpfile.js
File metadata and controls
35 lines (31 loc) · 901 Bytes
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
var gulp = require('gulp');
var concat = require('gulp-concat');
var ngAnnotate = require('gulp-ng-annotate');
var uglify = require('gulp-uglify');
var nodemon = require('gulp-nodemon');
var browserSync = require('browser-sync');
gulp.task('build', function () {
gulp.src(['public/admin/js/app.js',
'!public/admin/js/bundle.js',
'public/admin/**/*.js'])
.pipe(ngAnnotate())
.pipe(concat('bundle.js'))
.pipe(uglify())
.pipe(gulp.dest('public/admin/js'))
})
gulp.task('start', ['watch'], function () {
nodemon({
script: 'server.js'
, ext: 'js html'
, env: { 'NODE_ENV': 'development' }
})
})
gulp.task('browser-sync', function() {
browserSync({
proxy: "localhost:8080"
});
})
gulp.task('watch', ['browser-sync'], function () {
gulp.watch('public/admin/**/*.js', ['build']);
gulp.watch('public/admin/css/*.css').on('change', browserSync.reload);
})