VUE项目 使用build打包时关于svg报错问题解决办法 - Go语言中文社区

VUE项目 使用build打包时关于svg报错问题解决办法


今天使用build打包vue项目的时候疯狂报错,报错信息如下:

building for production...Error processing file: static/css/app.316977a049dccd7ae4089d9226e81a34.css
(node:11888) UnhandledPromiseRejectionWarning: postcss-svgo: Error in parsing SVG: Unquoted attribute value
Line: 0
Column: 14
Char: 
(node:11888) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:11888) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

这里提示打包出来的静态资源中的css文件中的svg引用必须使用双引号。
具体是指的什么呢?
在项目中,我引用了mui的icon。
目录结构
然后打开mui.css,查找svg,发现了2处引用,将单引号修改成双引号,如下
修改成双引号
然后再同样在mui.min.css修改一下。
在重新运行npm run build 就打包成功啦!

版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/weixin_44288627/article/details/85313261
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2020-03-07 22:09:46
  • 阅读 ( 1084 )
  • 分类:前端

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢