-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.babel.js
38 lines (32 loc) · 1.02 KB
/
gulpfile.babel.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
import gulp from 'gulp';
import sass from 'gulp-sass';
import rename from 'gulp-rename';
import cssBase64 from 'gulp-css-base64';
import uglifycss from 'gulp-uglifycss';
import cssInject from 'gulp-proxy-inject-css';
const inject = cssInject('github.com');
export const build = () => {
return gulp.src(['./scss/userstyle.scss'])
.pipe(sass().on('error', sass.logError))
.pipe(cssBase64({ baseDir: './img', extensionsAllowed: ['.png'] }))
.pipe(uglifycss({
'maxLineLen': 80,
'cuteComments': true,
'comments': 'license'
}))
.pipe(rename({
'basename': 'WinHub-98',
'suffix': '.user'
}))
.pipe(gulp.dest('./dist'));
};
export const livereload = () => {
return gulp.src(['./scss/main.scss'])
.pipe(sass().on('error', sass.logError))
.pipe(cssBase64({ baseDir: './img', extensionsAllowed: ['.png'] }))
.pipe(uglifycss())
.pipe(inject());
};
export const watch = () => {
gulp.watch(['./scss/**/*.scss', './scss/*.scss'], { ignoreInitial: false }, livereload);
};