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] postcss-pxtorem didn't work as envisaged #12640

Closed
Zoeyxyz opened this issue Feb 21, 2024 · 2 comments
Closed

[Bug Report] postcss-pxtorem didn't work as envisaged #12640

Zoeyxyz opened this issue Feb 21, 2024 · 2 comments

Comments

@Zoeyxyz
Copy link

Zoeyxyz commented Feb 21, 2024

Reproduction Link

https://stackblitz.com/edit/vitejs-vite-rdai5m?file=vite.config.js,package.json,index.html,package-lock.json,src%2Fmain.js&terminal=dev

Vant Version

4.8.4

Describe the Bug

css: {
    postcss: {
      plugins: [
        postCssPxToRem({
          rootValue({ file }) {
            return file.indexOf("vant") !== -1 ? 37.5 : 75;
          },
          propList: ["*"],
        }),
      ],
    },
},
server: {

使用vite构建项目,全局引入,偶现转换错误

Reproduce Steps

使用vite创建一个空白项目即可复现
node版本
18.19.0

Device / Browser

No response

@chenjiahan
Copy link
Member

这个问题和 Vant 无关,可以反馈给 postCssPxToRem or Vite

@li-shifeng
Copy link

使用 "postcss-pxtorem": "^5.1.1" 降低 postcss-pxtorem 的版本可以解决,参考:cuth/postcss-pxtorem#87

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

3 participants