代码拉取完成,页面将自动刷新
/**
* Description: reauired, the file description, reference link, etc.
* Created Date: 2021-03-22 7:32:39 PM
* Author: Liu Man <lm@hcttop.com>
* -----
* Last Modified: 2021-03-22, 7:32:39 PM
* Modified By: Liu Man <lm@hcttop.com>
*/
const path = require('path');
const gulp = require('gulp');
const cleanCSS = require('gulp-clean-css');
const cssWrap = require('gulp-css-wrap');
const LIGHT_THEME = '.light';
const DARK_THEME = '.dark';
const GREEN_THEME = '.green';
const BLUE_THEME = '.blue';
gulp.task('css-wrap-light', () =>
gulp
.src(path.resolve('./theme/light/index.css'))
.pipe(cssWrap({ selector: LIGHT_THEME }))
.pipe(cleanCSS())
.pipe(gulp.dest('./src/assets/theme/light'))
);
gulp.task('css-wrap-dark', () =>
gulp
.src(path.resolve('./theme/dark/index.css'))
.pipe(cssWrap({ selector: DARK_THEME }))
.pipe(cleanCSS())
.pipe(gulp.dest('./src/assets/theme/dark'))
);
gulp.task('css-wrap-blue', () =>
gulp
.src(path.resolve('./theme/blue/index.css'))
.pipe(cssWrap({ selector: BLUE_THEME }))
.pipe(cleanCSS())
.pipe(gulp.dest('./src/assets/theme/blue'))
);
gulp.task('css-wrap-green', () =>
gulp
.src(path.resolve('./theme/green/index.css'))
.pipe(cssWrap({ selector: GREEN_THEME }))
.pipe(cleanCSS())
.pipe(gulp.dest('./src/assets/theme/green'))
);
gulp.task('move-font-light', () =>
gulp
.src(['./theme/light/fonts/**'])
.pipe(gulp.dest('./src/assets/theme/light/fonts'))
);
gulp.task('move-font-dark', () =>
gulp
.src(['./theme/dark/fonts/**'])
.pipe(gulp.dest('./src/assets/theme/dark/fonts'))
);
gulp.task('move-font-blue', () =>
gulp
.src(['./theme/blue/fonts/**'])
.pipe(gulp.dest('./src/assets/theme/blue/fonts'))
);
gulp.task('move-font-green', () =>
gulp
.src(['./theme/green/fonts/**'])
.pipe(gulp.dest('./src/assets/theme/green/fonts'))
);
// gulp v4
// https://www.liquidlight.co.uk/blog/how-do-i-update-to-gulp-4/
gulp.task(
'light',
gulp.series(['css-wrap-light', 'move-font-light'], function(done) {
// default task code here
done();
})
);
gulp.task(
'dark',
gulp.series(['css-wrap-dark', 'move-font-dark'], function(done) {
// default task code here
done();
})
);
gulp.task(
'blue',
gulp.series(['css-wrap-blue', 'move-font-blue'], function(done) {
// default task code here
done();
})
);
gulp.task(
'green',
gulp.series(['css-wrap-green', 'move-font-green'], function(done) {
// default task code here
done();
})
);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。