1 Star 0 Fork 0

neterm/element-theme

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.js 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
neterm 提交于 2021-07-29 19:43 +08:00 . 调整监听所有scss文件改动
var gulp = require('gulp')
var series = require('run-sequence').use(gulp)
var task = require('./lib/task')
var vars = require('./lib/gen-vars')
var config = require('./lib/config')
var build = function (opts) {
return function () {
return task.build(Object.assign(opts, {message: 'build element theme'}))
}
}
var fonts = function (opts) {
return function () {
return task.fonts(Object.assign(opts, {message: 'build theme font'}))
}
}
exports.init = function (filePath) {
filePath = {}.toString.call(filePath) === '[object String]' ? filePath : ''
vars.init(filePath)
}
exports.watch = function (opts) {
gulp.task('build', build(opts))
exports.run(opts)
// gulp.watch(opts.config || config.config, ['build'])
// 只监听element-variables.scss
let config = opts.config || config.config
let themePath = opts.themePath || config.themePath
gulp.watch([config,themePath + '/src/**/*.scss', '!'+themePath + '/src/common/var.scss'], ['build'])
}
exports.run = function (opts, cb) {
gulp.task('build', build(opts))
gulp.task('fonts', fonts(opts))
if (typeof cb === 'function') {
return series('build', 'fonts', cb);
}
return series('build', 'fonts');
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/neterm/element-theme.git
git@gitee.com:neterm/element-theme.git
neterm
element-theme
element-theme
master

搜索帮助