首页 > 其他分享 >编译elementUI主题scss

编译elementUI主题scss

时间:2024-07-04 09:01:12浏览次数:15  
标签:scss src pipe elementUI dest gulp 编译 theme css

element Vue2工程

1.  安装包

"gulp": "^4.0.2",
"gulp-autoprefixer": "^8.0.0",
"gulp-minify-css": "^1.2.4",
"gulp-sass": "^4.0.2",
"gulp-uglify": "^3.0.2",

2. theme.js

// 编译生成ElementUI主题
// yarn run theme 生成文件比较小,建议此方式,https://blog.csdn.net/weixin_36813246/article/details/126985045

const { series, src, dest } = require("gulp"); const sass = require("gulp-sass"); const autoprefixer = require("gulp-autoprefixer"); const cssmin = require("gulp-minify-css"); const jsmin = require("gulp-uglify"); function compile() { // 压缩字体图标 src("./src/assets/iconfont.css").pipe(cssmin()).pipe(dest("./public/css")); // 压缩nprogress src("./src/assets/nprogress/nprogress.css") .pipe(cssmin()) .pipe(dest("./public/css")); src("./src/assets/nprogress/nprogress.js") .pipe(jsmin()) .pipe(dest("./public/js")); return ( src("./src/assets/element.scss") // 转成CSS .pipe(sass()) // 浏览器兼容性 .pipe( autoprefixer({ // 美化前缀 cascade: true, }) ) // 压缩 .pipe(cssmin()) // 输出目录 .pipe(dest("./public/css")) ); // 在当前目录下的assets文件夹输出最终文件 } exports.build = series(compile);

3. 添加package.json命令

"theme": "gulp build --gulpfile theme.js"

4. 执行

yarn theme

 

标签:scss,src,pipe,elementUI,dest,gulp,编译,theme,css
From: https://www.cnblogs.com/lobtao/p/18282874

相关文章

  • Linux下编译Azerothcore源码
    前言终于开始介绍Linux下如何编译AzerothCore源码了,本文编译和架设方法较为繁琐和细致,含Ubuntu、Debian和Docker(相较之前的Docker教程来说本文是手动版),且涉及到搭建注册网站和对外开放服务部分,故再次声明:本网站均为技术研究,若参考本网站教程搭建对外服务,我均不负任何责任!系统环......
  • Docker编译Azerothcore源码
    维基百科Docker是一个开放源代码软件,是一个开放平台,用于开发应用、交付(shipping)应用、运行应用。Docker允许用户将基础设施(Infrastructure)中的应用单独分割出来,形成更小的颗粒(容器),从而提高交付软件的速度。Docker容器与虚拟机类似,但二者在原理上不同。容器是将操作系统层虚拟......
  • [debug]解决cmake编译报错:can not be used when making a PIE object:recompile with -
    问题描述最近在跟施磊老师的高性能服务器项目,使用make命令后一直报错以下问题解决方法报错一大堆recompilewith-fPIC,多半是链接静态库是出错了。根据网上经验,在CmakeLists文件中加入-no-pie,但是两种方法进行尝试后都没有效果。#第一种方法add_compile_options(-fPIC)#......
  • 编译安装Kubernetes 1.29 高可用集群(6)--Cilium网络组件和CoreDNS配置
    1.部署Cilium网络组件1.1在k8s-master节点上,下载安装helmwgethttps://mirrors.huaweicloud.com/helm/v3.15.2/helm-v3.15.2-linux-amd64.tar.gztar-zxvfhelm-v3.15.2-linux-amd64.tar.gzcplinux-amd64/helm/usr/bin/#helmversionversion.BuildInfo{Version:"v3.1......
  • 编译原理 第六章&编译原理必考大题: 语义分析及中间代码生成&必考大题语句翻译
    第六章语义分析及中间代码生成&必考大题语句翻译文章目录第六章语义分析及中间代码生成&必考大题语句翻译写在最前6.1语义分析6.2中间代码6.2.1逆波兰式6.2.2四元式6.2.3三元式6.3语句翻译(必考大题)6.3.1布尔表达式的翻译6.3.2if语句的翻译6.3.3while语句翻......
  • 使用ElementUI组件库
    引入ElementUI组件库        1.安装插件npmielement-ui-S    2.引入组件库importElementUIfrom'element-ui';    3.引入全部样式import'element-ui/lib/theme-chalk/index.css';    4.使用Vue.use(ElementUI);    ......
  • 编译Open Cascade(OCC)并使用C#进行开发
    说明:VS版本:VisualStudioCommunity2022系统:Windows11专业版23H2OpenCASCADE:v7.7.0(链接:https://pan.baidu.com/s/1-o1s4z3cjpYf5XkwhSDspQ?pwd=p9i5提取码:p9i5)下载和安装OCCDownload-OpenCASCADETechnology​​​安装MSVC​打开文件夹“C:\OpenCASCADE-......
  • centos系统构建安装john导致的编译问题error: size of array element is not a multip
    blake2.h:112:5:error:sizeofarrayelementisnotamultipleofitsalignment112|blake2b_stateS[4][1];|^~~~~~~~~~~~~blake2.h:113:5:error:sizeofarrayelementisnotamultipleofitsalignment113|blake2b_stateR[1];......
  • 探索Mojo语言的编译器优化:提升性能的秘诀
    ......
  • vue elementUI el-tree 下拉树功能(包括搜索/默认高亮/展开下拉框默认定位于选中项的位
    <template><div><el-form:model="formData"ref="refFormData"label-width="180px"><el-form-itemlabel="景点"prop="location_id"><el-selectv-model="formData.location_name&qu......