当前位置:网站首页>Getting Started Doc 08 Conditional Plugins
Getting Started Doc 08 Conditional Plugins
2022-08-05 06:08:00 【dongsdh】
Getting Started Document 06 Adding Files to the Stream_dongsdh's Blog-CSDN Blog
This is an optimization of the above two content
Find all scss, css style files
Conditional judgment, only convert the scss file to css
Then let them merge together, compress,,,
Complete a task and get the final desired result
const { src, dest, series, watch, parallel } = require("gulp");const gulpif = require('gulp-if');// // Convert scss to cssconst sass = require("gulp-sass")(require("sass"));//mergeconst concat = require('gulp-concat');//compressionconst cssmin = require("gulp-cssmin")function isScss(file) {return file.extname === '.scss';}function clean(cb) {console.log('cleanup');cb()}function js(cb) {console.log('processing js');cb();}function scssCss(cb) {console.log('Process scss and css at the same time');src(['src/**/*.scss','src/**/*.css']) //find all scss, css style files.pipe(gulpif(isScss, sass())) // only convert scss files to css.pipe(concat('appbuild.css')) //Merge css, you must take a merged file name.pipe(cssmin()) //compression.pipe(dest('./dist/'));cb();}function img(cb) {console.log('processing img');cb();}function build(cb) {console.log('Packaging');cb();}exports.default = series(clean, js, img, scssCss, build);
边栏推荐
猜你喜欢
随机推荐
成功的独立开发者应对失败&冒名顶替综
[Paper Intensive Reading] Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation (R-CNN)
网站ICP备案是什么呢?
Autoware中安装Yolo3目标检测模块遇到的问题
UE5再次更新!扫描或手动建模面部模型可直接转为绑定好的Metahuman
每日一题-单调栈
链表章6道easy总结(leetcode)
每日一题-下一个排列-0723
乘云科技受邀出席2022阿里云合作伙伴大会荣获“聚力行远奖”
I217-V在openwrt软路由下大流量断网问题
一个小时教你如何掌握ts基础
Contextual non-local alignment of full-scale representations
spark源码-任务提交流程之-4-container中启动executor
【3D模型教程】ZBrush如何表现皮肤纹理?
Spark源码-任务提交流程之-6.2-sparkContext初始化-TaskScheduler任务调度器
【Day8】(超详细步骤)使用LVM扩容
spark源码-任务提交流程之-2-YarnClusterApplication
(C语言)动态内存管理
每日一题-三数之和-0716(2)
【Day5】软硬链接 文件存储,删除,目录管理命令









