-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathgulpfile.js
47 lines (39 loc) · 1.15 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
var gulp = require('gulp');
var concat = require("gulp-concat");
var annotate = require("gulp-ng-annotate");
var sass = require("gulp-sass");
var nodemon = require('gulp-nodemon');
var paths = {
jsSource: ['public/app/**/*.js'],
sassSource: ['public/**/*.sass'], // Change sass to scss if you want to work with it instead.
copySource: ['public/**/*.html', 'public/**/*.css'],
server: ['server/index.js']
};
gulp.task('serve', function() {
nodemon({
'script': paths.server
});
});
gulp.task('sass', function() {
gulp.src(paths.sassSource)
.pipe(sass())
.pipe(concat('bundle.css'))
.pipe(gulp.dest('./dist'));
});
gulp.task('js', function() {
gulp.src(paths.jsSource)
.pipe(annotate())
.pipe(concat('bundle.js'))
.pipe(gulp.dest('./dist'));
});
gulp.task('copy', function() {
gulp.src(paths.copySource)
.pipe(gulp.dest('./dist'));
});
gulp.task('build', ['js', 'sass', 'copy']);
gulp.task('watch', function() {
gulp.watch(paths.jsSource, ['js']);
gulp.watch(paths.sassSource, ['sass']);
gulp.watch(paths.copySource, ['copy']);
});
gulp.task('default', ['build', 'watch']); // add 'serve' to the array if you want gulp to run nodemon as well.