forked from museui/muse-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
37 lines (34 loc) · 1.11 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
const gulp = require('gulp')
const less = require('gulp-less')
const rename = require('gulp-rename')
const concat = require('gulp-concat')
const minify = require('gulp-clean-css')
gulp.task('theme:style', function () {
return gulp.src(['./src/*/theme.less'])
.pipe(concat('theme.less'))
.pipe(gulp.dest('./less'))
})
gulp.task('theme:var', function () {
return gulp.src(['./src/*/var.less'])
.pipe(concat('theme-vars.less'))
.pipe(gulp.dest('./less'))
})
gulp.task('theme:less', function () {
return gulp.src(['./src/styles/colors.less', './src/styles/mixins.less', './src/styles/vars.less'])
.pipe(gulp.dest('./less'))
})
gulp.task('theme', ['theme:var', 'theme:style', 'theme:less'], function () {
return gulp.src('./src/styles/themes/*.less')
.pipe(less())
.pipe(rename({
dirname: '',
prefix: 'theme-',
extname: '.css'
}))
.pipe(gulp.dest('./dist'))
.pipe(minify())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('./dist'))
})