element-plus/packages/theme-chalk/gulpfile.js

31 lines
787 B
JavaScript
Raw Normal View History

'use strict'
/* eslint-disable @typescript-eslint/no-var-requires */
const { series, src, dest } = require('gulp')
const sass = require('gulp-dart-sass')
const autoprefixer = require('gulp-autoprefixer')
const cssmin = require('gulp-cssmin')
2020-11-23 14:33:20 +08:00
const rename = require('gulp-rename')
2020-11-23 16:28:06 +08:00
const noElPrefixFile = /(index|base|display)/
2020-11-23 15:07:53 +08:00
function compile() {
return src('./src/*.scss')
.pipe(sass.sync())
2020-09-15 16:10:32 +08:00
.pipe(autoprefixer({ cascade: false }))
.pipe(cssmin())
2020-11-23 14:33:20 +08:00
.pipe(rename(function (path) {
2020-11-23 15:07:53 +08:00
if(!noElPrefixFile.test(path.basename)) {
2020-11-23 14:33:20 +08:00
path.basename = `el-${path.basename}`
}
}))
.pipe(dest('./lib'))
}
function copyfont() {
return src('./src/fonts/**')
.pipe(cssmin())
.pipe(dest('./lib/fonts'))
}
exports.build = series(compile, copyfont)