-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
33 lines (27 loc) · 975 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
var gulp = require('gulp');
var sass = require('gulp-sass');
var htmlclean = require('gulp-htmlclean');
var cleanCSS = require('gulp-clean-css');
var uglify = require('gulp-uglify');
var paths = {
src: 'src',
srcSCSS: 'src/scss/',
srcCSS: 'src/css/',
srcJS: 'src/js/',
tmp: 'tmp',
tmpCSS: 'tmp/css/',
tmpJS: 'tmp/js/js/',
};
gulp.task('sass', function() {
return gulp.src([paths.srcSCSS + 'site.scss']).pipe(sass()).pipe(cleanCSS()).pipe(gulp.dest(paths.tmpCSS)).pipe(gulp.dest(paths.srcCSS));
});
gulp.task('scripts', function() {
return gulp.src(paths.srcJS + '*.js').pipe(uglify()).pipe(gulp.dest(paths.tmpJS));
});
gulp.task('htmlClean', function () {
return gulp.src(paths.srcPHP + '*.ejs').pipe(htmlclean()).pipe(gulp.dest(paths.tmpPHP));
});
gulp.task('watch', function() {
gulp.watch(['./src/scss/*.scss', './src/scss/components/*.scss'], gulp.task('sass'));
gulp.watch('./src/js/*.js', gulp.task('scripts'));
});