-
Notifications
You must be signed in to change notification settings - Fork 21
/
gulpfile.js
57 lines (43 loc) · 1.29 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
49
50
51
52
53
54
55
56
57
const {series, src, dest} = require('gulp')
const rename = require('gulp-rename')
const sass = require('gulp-sass')(require('sass'))
/* Destination dir (demo or not)? */
function destDir ( isDemo ) {
return isDemo ? './demo/css' : './css'
}
/* SCSS & CSS */
function processScssFn ( outputStyle, isDemo ) {
const outName = outputStyle === 'compressed' ? 'main.min.css' : 'main.css'
return src('bulma-responsive-tables.scss')
.pipe(sass({outputStyle}).on('error', sass.logError))
.pipe(rename(outName))
.pipe(dest(destDir(isDemo)))
}
function processScssExpanded () {
return processScssFn('expanded')
}
function processScssCompressed () {
return processScssFn('compressed')
}
function processScssCompressedDemo () {
return processScssFn('compressed', true)
}
/* Compile Bulma.min.css for demo */
function processBulmaSassFn ( isDemo ) {
return src('node_modules/bulma/bulma.sass')
.pipe(sass({outputStyle:'compressed'}).on('error', sass.logError))
.pipe(rename('bulma.min.css'))
.pipe(dest(destDir(isDemo)))
}
function processBulmaSass () {
return processBulmaSassFn()
}
function processBulmaSassDemo () {
return processBulmaSassFn(true)
}
exports.default = series(
processScssExpanded,
processScssCompressed,
processScssCompressedDemo,
processBulmaSassDemo
)