forked from moonrhythm/biomatic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
65 lines (59 loc) · 1.43 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
58
59
60
61
62
63
64
65
const gulp = require('gulp')
const sass = require('gulp-sass')
const autoprefixer = require('gulp-autoprefixer')
const rename = require('gulp-rename')
gulp.task('build-full', function() {
const outputConfigs = {
src: './src/build-full.scss',
prefix: 'biomatic.',
basename: 'full'
}
generateCSS(outputConfigs)
})
gulp.task('build-atomic', function() {
const outputConfigs = {
src: './src/build-atomic.scss',
prefix: 'biomatic.',
basename: 'atomic'
}
generateCSS(outputConfigs)
})
gulp.task('build-component', function() {
const outputConfigs = {
src: './src/build-component.scss',
prefix: 'biomatic.',
basename: 'component'
}
generateCSS(outputConfigs)
})
gulp.task('build-layout', function() {
const outputConfigs = {
src: './src/build-layout.scss',
prefix: 'biomatic.',
basename: 'layout'
}
generateCSS(outputConfigs)
})
gulp.task('build-utility', function() {
const outputConfigs = {
src: './src/build-utility.scss',
prefix: 'biomatic.',
basename: 'utility'
}
generateCSS(outputConfigs)
})
function generateCSS({ src = '', prefix = '', basename = '' }) {
gulp
.src(src)
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(autoprefixer({browsers: ['last 2 versions']}))
.pipe(
rename({
basename,
prefix,
suffix: '.min',
extname: '.css'
})
)
.pipe(gulp.dest('./dist/'))
}