import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import AutoImport from 'unplugin-auto-import/vite' import Components from 'unplugin-vue-components/vite' import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' import postCssPxToRem from "postcss-pxtorem"; // https://vitejs.dev/config/ // export default defineConfig({ // plugins: [ // vue(), // Components({ // resolvers: [ElementPlusResolver()] // }), // AutoImport({ // resolvers: [ElementPlusResolver()] // }) // ] // }) export default defineConfig({ plugins: [ vue(), Components({ resolvers: [ElementPlusResolver()] }), AutoImport({ resolvers: [ElementPlusResolver()] }) ], css: { postcss: { plugins: [postCssPxToRem({ rootValue: 192, // 1rem,根据 设计稿宽度/10 进行设置 propList: ['*'] // 需要转换的属性,这里选择全部都进行转换 })] } } })