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

vite+scss+vant rootValue not match file #441

Closed
ixqbar opened this issue Sep 12, 2024 · 1 comment
Closed

vite+scss+vant rootValue not match file #441

ixqbar opened this issue Sep 12, 2024 · 1 comment

Comments

@ixqbar
Copy link

ixqbar commented Sep 12, 2024

module.exports = {
    plugins: {
        'postcss-pxtorem': {
            rootValue({ file }) {
				console.log(file, file.includes('node_modules/vant'))
                return file.includes('node_modules/vant') ? 37.5 : 75;
            },
            propList: ['*'],
        },
    },
}
image image image image image image

不确定到底是vite, postcss-pxtorem, 或者是sass-embedded 谁的问题

System Info

"vant": "^4.9.5",
"vue": "^3.5.4",


"devDependencies": {
    "@vant/auto-import-resolver": "^1.2.1",
    "@vitejs/plugin-vue": "^5.1.3",
    "autoprefixer": "^10.4.20",
    "postcss-pxtorem": "^6.1.0",
    "sass-embedded": "^1.78.0",
    "unplugin-auto-import": "^0.18.2",
    "unplugin-vue-components": "^0.27.4",
    "vite": "^5.4.4",
    "vite-plugin-compression": "^0.5.1"
  }
@zhaojjiang
Copy link

zhaojjiang commented Sep 13, 2024

I think it is bug belongs to postcss-pxtorem, downgrade postcss-pxtorem to v5.x to solve this

@ixqbar ixqbar closed this as completed Sep 14, 2024
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