-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (40 loc) · 998 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
37
38
39
40
41
42
43
44
//include gulp
let gulp = require("gulp");
let rename = require("gulp-rename");
let sass = require("gulp-sass");
let uglify = require('gulp-uglify');
let concat = require('gulp-concat');
//Scripts
gulp.task('scripts', function() {
gulp.src([
'./src/scripts/site.js'
])
.pipe(concat({
path: 'site.js'
}))
.pipe(gulp.dest('./web/js/'))
.pipe(uglify())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('./web/js/'));
});
//SASS Compile
gulp.task('styles', function() {
gulp.src(['./src/styles/site.scss'])
.pipe(sass())
.pipe(concat('site.css'))
.pipe(gulp.dest('./web/css/'))
.pipe(sass({outputStyle: 'compressed'}))
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('./web/css/'));
});
//watch files
gulp.task('watch', function(){
gulp.start('styles');
gulp.start('scripts');
gulp.watch('./src/styles/*.scss', ['styles']);
gulp.watch('./src/scripts/*.js', ['scripts']);
});
//default tasks
gulp.task('default', ['scripts', 'styles']);