element-plus/packages/theme-chalk/gulpfile.js
2020-11-23 15:07:53 +08:00

31 lines
779 B
JavaScript

'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')
const rename = require('gulp-rename')
const noElPrefixFile = /(index|base)/
function compile() {
return src('./src/*.scss')
.pipe(sass.sync())
.pipe(autoprefixer({ cascade: false }))
.pipe(cssmin())
.pipe(rename(function (path) {
if(!noElPrefixFile.test(path.basename)) {
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)