You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
import eslintPlugin from 'vite-plugin-eslint'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { VantResolver } from '@vant/auto-import-resolver'
import vitePluginStyleVwLoader from 'vite-plugin-style-vw-loader'
export default function createVitePlugins() {
return [
vitePluginStyleVwLoader({ viewportWidth: 375 }), // 该插件需要放在vue()之前
vue(),
vueDevTools(),
eslintPlugin({
include: ['src//*.js', 'src//.vue', 'src/.js', 'src/*.vue']
}),
AutoImport({
imports: ['vue', 'vue-router', 'pinia'],
dts: './types/auto-import.d.ts',
eslintrc: {
enabled: true,
filepath: './.eslintrc-auto-import.json'
},
resolvers: [VantResolver()]
}),
Components({
dirs: ['src/components'], // 自动导入全局组件
resolvers: [VantResolver()] // 自动按需导入vant组件
})
]
}
Beta Was this translation helpful? Give feedback.
All reactions