youzan / vant

A lightweight, customizable Vue UI library for mobile web apps.
https://vant.pro/vant/
MIT License
23.24k stars 9.49k forks source link

Icon组件less编译错误 #9570

Closed yangtianxia closed 3 years ago

yangtianxia commented 3 years ago

你好,请使用下面的链接创建 issue 以帮助我们更快的排查问题,不规范的 issue 会被关闭,感谢配合。

http://vant-contrib.gitee.io/vant-issue-generater


版本 v3.2.4

无法编译 https://github.com/youzan/vant/blob/4494d854913d204d7e6081b2595d8571789bb4f1/packages/vant/src/icon/index.less#L1

in ./node_modules/vant/es/icon/index.less

Syntax Error:

}
@import '@vant/icons/src/encode-woff2.less';
^
Can't resolve './@vant/icons/src/encode-woff2.less' in 'E:\Vue\mobile-mall-ts\node_modules\vant\es\icon'
      in E:\Vue\mobile-mall-ts\node_modules\vant\es\icon\index.less (line 160, column 0)

 @ ./node_modules/vant/es/icon/index.less 4:14-262 15:3-20:5 16:22-270
 @ ./node_modules/vant/es/cell/style/less.js
 @ ./src/main.ts

编译通过 v3.2.1 https://github.com/youzan/vant/blob/87b8e2b617b54377562f38df388a64b9c2cad4ea/src/icon/index.less#L1

Please use the link below to create a new issue, the non-standard issue will be closed.

https://youzan.github.io/vant-issue-generater

chenjiahan commented 3 years ago

这个问题可以通过升级 less-loader 到 6.0.0 以上版本来解决。

另外通过 less 进行主题定制的方式已经废弃了,建议改用 ConfigProvider 组件进行主题定制。