-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
41 lines (36 loc) · 1.05 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
var gulp = require('gulp'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
cssmin = require('gulp-cssmin'),
stripCssComments = require('gulp-strip-css-comments');
var scss = ['./sass/**/*.scss'],
css = ['./dist/css/bootstrap.css',
'./dist/css/main.css'],
js = ['./js/angular.min.js',
'./js/angular-route.min.js',
'./js/app.js',
'./js/controller.js'];
gulp.task('scss', function() {
gulp.src(scss)
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./dist/css/'));
});
gulp.task('styles', function(){
gulp.src(css)
.pipe(concat('styles.min.css'))
.pipe(stripCssComments({all: true}))
.pipe(cssmin())
.pipe(gulp.dest('./dist/css/'));
});
gulp.task('scripts', function() {
gulp.src(js)
.pipe(concat('scripts.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./dist/js/'));
});
gulp.task('default',function() {
gulp.watch(scss, ['scss']);
gulp.watch(css, ['styles']);
gulp.watch(js, ['scripts']);
});