-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
43 lines (38 loc) · 1011 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
const gulp = require('gulp')
const sass = require('gulp-sass')(require('sass'))
const fileInclude = require('gulp-file-include')
const concat = require('gulp-concat')
const cssmin = require('gulp-cssmin');
function style() {
return gulp.src('./src/scss/**/*.scss')
.pipe(sass())
.pipe(cssmin())
.pipe(concat('main.css'))
.pipe(gulp.dest('.'))
}
function cssMinify() {
return gulp.src('./src/css/*.css')
.pipe(cssmin())
.pipe(concat('styles.css'))
.pipe(gulp.dest('.'))
}
const include = () =>
gulp
.src(["./src/pages/*.html" ])
.pipe(
fileInclude({
prefix: "@@",
basepath: "@file",
})
)
.pipe(gulp.dest("./"));
function watch() {
gulp.watch("./src/pages/**/*.html", include);
gulp.watch('./src/sections/**/*.html', include)
gulp.watch('./src/scss/**/*.scss', style)
gulp.watch('./src/scss/*.scss', style)
}
exports.cssMinify = cssMinify
exports.style = style
exports.watch = watch
exports.include = include