Vue3+vite配置postcss-pxtorem报错[plugin:vite:css] Failed to load PostCss config
1.安装依赖
npm install postcss-pxtorem -D
2.设置规则(更改postcss.config.js,该文件为使用vue-cli3自动创建的文件,vite创建的项目,在项目根目录下添加postcss.config.js文件)
module.exports = {
'plugins': {
'autoprefixer': {
overrideBrowserslist: [
'Android 4.1',
'iOS 7.1',
'Chrome > 31',
'not ie <= 11',
'ff >= 30',
'> 1%',
'last 2 versions', // 所有主流浏览器最近2个版本
],
grid: true ,
},
'postcss-pxtorem': {
rootValue: 16,
unitPrecision: 6,
selectorBlackList: ['.no-rem', 'no-rem'],
propList: ['*'],
replace: true,
mediaQuery: true,
minPixelValue: 2,
exclude: /node_modules/i
}
}
}
3.如果项目报错[plugin:vite:css] Failed to load PostCss config
[vite] Internal server error: Failed to load PostCSS config
解决办法:将postcss.config.js文件后缀 改为 .cjs -----postcss.config.cjs
Vue3+vite配置postcss-pxtorem报错[plugin:vite:css] Failed to load PostCss config相关推荐
- Vue3配置postcss-pxtorem报错[plugin:vite:css] Failed to load PostCss config
解决办法:把postcss.config.js的后缀名改成postcss.config.cjs 1.安装依赖 npm install postcss postcss-pxtorem --save-de ...
- 报错解决办法 SLF4J: Failed to load class org.slf4j.impl.StaticLoggerBinder
<dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-nop</a ...
- 使用TS+vue3封装axios时编译报错,提示You may need an additional loader to handle the result of these loaders.
基于vue3+TS构建的商城后台管理系统 根据coderwhy老师指导搭建的项目为PC端商品后台管理系统. 报错: 使用TS+vue3封装axios时编译报错,提示You may need an ad ...
- mysql逻辑删除的区别_不能和逻辑删除一起配置,不然报错。
源自:8-1 SQL注入器简介及自定义方法实现 不能和逻辑删除一起配置,不然报错. 逻辑删除的配置:@Bean public ISqlInjector sqlInjector(){ return ne ...
- 更改yum源配置后执行报错[Errno 14] PYCURL ERROR 22 - “The requested URL returned error: 404 Not Found”
更改yum源配置后执行报错 报错信息入下 //[root@bucktanc6 yum.repos.d]# yum clean all Loaded plugins: fastestmirror Cle ...
- php永久mediaid,幺蛾子事件之-zabbix配置告警媒介报错mediaid重复
幺蛾子事件之-zabbix配置告警媒介报错mediaid重复 admin • 2020 年 12 月 21 日 直接开篇点题好吧zabbix运行一段时间后,添加报警媒介类型后,添加收件人信息后保存报错 ...
- IDEA启动报错Plugin Error Problems found loading plugins: Plugin “GlassFish Integration“ was not...
IDEA启动报错Plugin Error的解决办法: Problems found loading plugins: Plugin "Persistence Frameworks Suppo ...
- 【问题篇】Springboot解决报错“java.sql.SQLException: Unable to load authentication plugin ‘caching_sha2_passw”
场景:从代码仓库拉取以前的代码,运行时发现报错"java.sql.SQLException: Unable to load authentication plugin 'caching_sh ...
- springboot配置日志文件报错:
前言 springboot配置日志文件报错: 错误信息如下: ERROR in ch.qos.logback.core.joran.spi.Interpreter@3:65 - no applicab ...
最新文章
- python海龟画笔如何运行_Python海龟绘图:turtle的简单使用
- 阿尔法特磁悬浮制冷机组荣获“2016年度中国数据中心优秀节能产品”殊荣
- foreach判断最后一个_PHP 内核:foreach 是如何工作的(二)
- MaxCompute Next
- 【论文阅读】Learning Traffic as Images: A Deep Convolutional ... [将交通作为图像学习: 用于大规模交通网络速度预测的深度卷积神经网络](1)
- Dreamweaver MX显示汉字为乱码的解决方法
- flink int序列化
- linux下的c语言编程实验4,实验四-Linux下的C语言编程
- mycat重启报错Failed to connect to the Wrapper at port解决方法
- python 图形库介绍_数据分析Python手绘图形库有哪些
- Atitti html5 h5 新特性attilax总结
- 算法动画图解(安卓)、排序算法的可视化
- Python 欧卡2导入音乐 批量转ogg格式
- 绩效考核管理方案文档
- PPT插入形状,在里面填写文字,文本框过大
- linux中/etc/hosts文件的含义
- 非对称加密和对称加密的优缺点
- 赛联区块链培训课程介绍
- [C++复健日常] for_each
- matlab的phim,matlab-LSQCURVEFIT函数的使用问题
热门文章
- Python编写一个程序来计算 BMI 值。
- PyQt5 密码输入框
- 最小角回归 LARS算法包的用法以及模型参数的选择(R语言 )
- 华为高管回应养猪传闻,赋能企业用AI养好猪
- HANA 01 HANA中的JOIN和NODE
- Can't update table 'psxt_user' in stored function/trigger because it is already used by statement wh
- 图像的形态学处理总结
- 3D测量| 主动模式投影提高AOI三维测量精度
- 使用Python读取markdown文件并统计字数
- C++ 泛型编程(五) 模版重载与特例化