-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
62 lines (56 loc) · 1.88 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
51
52
53
54
55
56
57
58
59
60
61
62
var gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
concat = require('gulp-concat'),
compass = require('gulp-compass'),
uglify = require('gulp-uglify');
gulp.task('compass', function() {
return gulp.src('./src/sass/*.scss')
.pipe(compass({
css: './public/css',
sass: './src/sass',
require: ['breakpoint','susy']
}))
.on('error', function() {
console.log("sass error TODO");
})
.pipe(gulp.dest('./public/css'));
});
gulp.task('autoprefixer', function() {
return gulp.src('./public/css/*.css')
.pipe(autoprefixer({
browsers: ['last 3 versions'],
cascade: false
}))
.pipe(gulp.dest('./public/css'));
});
//minified vendor javascript
gulp.task('scripts-vendor', function() {
return gulp.src([
'./src/bower_components/angular/angular.min.js',
'./src/bower_components/angular-resource/angular-resource.min.js',
'./src/bower_components/angular-route/angular-route.min.js',
'./src/bower_components/lodash/dist/lodash.underscore.min.js',
'./src/bower_components/angular-google-maps/dist/angular-google-maps.min.js'
])
.pipe(concat('vendor.js'))
.pipe(gulp.dest('./public/js/'));
});
//source javascript
gulp.task('scripts', function() {
return gulp.src([
'./src/js/*.js',
'./src/js/controllers/*.js',
'./src/js/services/*.js',
'./src/js/directives/*.js',
])
.pipe(concat('script.js'))
// .pipe(uglify())
.pipe(gulp.dest('./public/js/'));
});
//watch
gulp.task('watch', function() {
gulp.watch('./src/js/**/*.js', ['scripts']);
gulp.watch('./src/sass/**/*.scss', ['compass']);
});
//default task
gulp.task('default', ['scripts-vendor', 'scripts', 'compass', 'autoprefixer', 'watch']);