-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (39 loc) · 1.27 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
const { src, dest, series, watch } = require('gulp');
// styles
const scss = require('gulp-sass')(require('sass'));
const autoPrefixer = require('gulp-autoprefixer');
const cssMinify = require('gulp-clean-css');
function styles() {
return src('./library/src/css/**/*.scss')
.pipe(scss ())
.pipe(autoPrefixer('last 2 versions'))
.pipe(cssMinify() )
.pipe(dest('./library/dist/styles/'))
}
// function side_project_styles() {
// return src('./library/src/css/side_projects/**/*.scss')
// .pipe(scss ())
// .pipe(autoPrefixer('last 2 versions'))
// .pipe(cssMinify() )
// .pipe(dest('./library/dist/styles/side_projects/'))
// }
// scripts
const jsMinify = require('gulp-terser');
function scripts() {
return src('./library/src/js/**/*.js')
.pipe(jsMinify())
.pipe(dest('./library/dist/scripts/'))
}
// function side_project_scripts() {
// return src('./library/src/js/side_projects/**/*.js')
// .pipe(jsMinify())
// .pipe(dest('./library/dist/scripts/side_projects/'))
// }
// watch
function watchTask() {
watch(
['./library/src/css/**/*.scss', './library/src/js/**/*.js'],
series(styles, scripts)
)
}
exports.default = series(styles, scripts, watchTask);