vitejs / vite-plugin-vue

Vite Vue Plugins
MIT License
474 stars 150 forks source link

vite+scss+vant rootValue not match file #441

Closed ixqbar closed 2 weeks ago

ixqbar commented 2 weeks ago
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 commented 2 weeks ago

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