当前位置:网站首页>Getting Started Document 07 Staged Output
Getting Started Document 07 Staged Output
2022-08-05 06:09:00 【dongsdh】
const { src, dest, series, watch, parallel } = require("gulp");// //es2016 to es2015const babelz = require("gulp-babel");//compressionconst uglify = require("gulp-uglify");function clean(cb) {console.log('clean up dist');cb();}function js(cb) {console.log('processing js');// first stage outputsrc('./src/js/common/echarts.min.js').pipe(dest("./dist/js/common"))// second stage outputsrc(['./src/js/**/*.js','!./src/js/common/echarts.min.js']).pipe(babelz({presets: ["es2015"],})).pipe(uglify()) //compress.pipe(dest("./dist/js/"))cb();}function css(cb) {console.log('processing css');cb();}function img(cb) {console.log('processing img');cb();}function build(cb) {console.log('Packaging');cb();}exports.default = series(clean, js, css, img, build);
echarts.min.js is already compressed, no need to compress any more, it will be migrated directly in the first stage without processing
Bypass the problem that the file size exceeds 500kb when packaging
边栏推荐
- IJCAI 2022|Boundary-Guided Camouflage Object Detection Model BGNet
- 什么?CDN缓存加速只适用于加速静态内容?
- framebuffer应用编程及文字显示(1)
- 来来来,一文让你读懂Cocos Creator如何读写JSON文件
- D39_坐标转换
- Autoware中安装Yolo3目标检测模块遇到的问题
- Getting Started 05 Using cb() to indicate that the current task is complete
- [Pytorch study notes] 8. How to use WeightedRandomSampler (weight sampler) when the training category is unbalanced data
- ROS视频教程
- D41_缓冲池
猜你喜欢
随机推荐
入门文档06 向流(stream)中添加文件
Autoware中安装Yolo3目标检测模块遇到的问题
电子产品量产工具(4)-UI系统实现
vim的三种模式
每日一题-最长回文子串-0714
每日一题-正则表达式匹配-0715
CIPU,对云计算产业有什么影响
每日一题-无重复字符的最长子串-0712
链表章6道easy总结(leetcode)
每日一题-盛最多水的容器-0716
CIPU,对云计算产业有什么影响
(C语言)计算结构体大小——结构体内存对齐
Apache配置反向代理
Contextual non-local alignment of full-scale representations
C语言程序死循环问题解析——变量被修改
每日一题-两数相加-0711
成功的独立开发者应对失败&冒名顶替综
【机器学习】1单变量线性回归
每日一题-字典
huatuo 革命性热更新解决方案系列1·1 为什么这么NB?huatuo革命Unity热更新