Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] vant-cli 在less中引入css文件 在yarn build打包时,引入的css部分不会被编译 #12914

Closed
qqqiyuan opened this issue Jun 5, 2024 · 1 comment

Comments

@qqqiyuan
Copy link

qqqiyuan commented Jun 5, 2024

重现链接

必现

Vant 版本

"@vant/cli": "6.2.0"

描述一下你遇到的问题。

在组件 index.less 文件中使用 @import 去引入一个css文件 如 @import '~vant/lib/button/index.css' ,则通过yarn build 命令构建出来的index.css文件中,css部分没有被编译,依旧是以 @import '~vant/lib/button/index.css' 的方式存在

重现步骤

  1. 在 组件A 的index.less文件中引入css文件
    @import '~vant/lib/button/index.css'
  2. 执行yarn build命令,构建完的 lib / 组件A / index.css文件中,@import "~vant/lib/button/index.css"; 这一行没有被编译

设备/浏览器

chrome

@chenjiahan
Copy link
Member

这个就是 Less 的默认行为,可以看下官方文档:https://lesscss.org/features/#import-atrules-feature-file-extensions

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants