forked from bornfight-studio/b-reset
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.esm.js
More file actions
50 lines (44 loc) · 991 Bytes
/
gulpfile.esm.js
File metadata and controls
50 lines (44 loc) · 991 Bytes
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
49
50
import gulp from 'gulp';
import sass from 'gulp-sass';
import rename from 'gulp-rename';
import cleanCSS from 'gulp-clean-css';
import del from 'del';
/**
* Paths
*/
const paths = {
styles: {
src: 'src/b-reset.scss',
dest: 'build/'
}
};
/**
* Clean build folder
*/
export const clean = () => del(['build']);
/**
* Compile SCSS to CSS
*/
export function styles() {
return gulp.src(paths.styles.src)
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(paths.styles.dest));
}
/**
* Compile SCSS to CSS with optimization
*/
export function stylesMin() {
return gulp.src(paths.styles.src)
.pipe(sass().on('error', sass.logError))
.pipe(cleanCSS())
.pipe(rename({
basename: 'b-reset',
suffix: '.min'
}))
.pipe(gulp.dest(paths.styles.dest));
}
const build = gulp.series(clean, gulp.parallel(styles, stylesMin));
/**
* Export a default task
*/
export default build;