-
Notifications
You must be signed in to change notification settings - Fork 49
/
gulpfile.js
36 lines (32 loc) · 929 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
36
var gulp = require('gulp');
var sass = require('gulp-sass');
var csso = require('gulp-csso');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
gulp.task('sass', function() {
gulp.src('./styles/styles.scss')
.pipe(sass())
.pipe(csso())
.pipe(gulp.dest('styles'));
});
gulp.task('compress', function() {
gulp.src([
'scripts/lib/jquery-2.1.0.min.js',
'scripts/lib/angular.min.js',
'scripts/lib/*.js',
'scripts/app.js',
'scripts/constants/*.js',
'scripts/controllers/*.js',
'scripts/directives/*.js',
'scripts/services/*.js'
])
.pipe(concat('compiled.js'))
.pipe(uglify())
.pipe(gulp.dest('scripts'));
});
gulp.task('watch', function() {
gulp.watch('styles/*.scss', ['sass']);
gulp.watch(['scripts/**/*.js', '!scripts/compiled.js'], ['compress']);
});
gulp.task('default', ['sass', 'compress', 'watch']);
gulp.task('build', ['compress']);