123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- /// <reference types="vitest" />
- import path from 'node:path'
- import { defineConfig } from 'vite'
- import Vue from '@vitejs/plugin-vue'
- import Pages from 'vite-plugin-pages'
- import Components from 'unplugin-vue-components/vite'
- import AutoImport from 'unplugin-auto-import/vite'
- import UnoCSS from 'unocss/vite'
- import VueMacros from 'unplugin-vue-macros/vite'
- import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
- import Icons from 'unplugin-icons/vite'
- import IconsResolver from 'unplugin-icons/resolver'
- export default defineConfig({
- resolve: {
- alias: {
- '~/': `${path.resolve(__dirname, 'src')}/`,
- },
- },
- plugins: [
- VueMacros({
- plugins: {
- vue: Vue({
- reactivityTransform: true,
- }),
- },
- }),
- // https://github.com/hannoeru/vite-plugin-pages
- Pages(),
- // https://github.com/antfu/unplugin-auto-import
- AutoImport({
- imports: [
- 'vue',
- 'vue/macros',
- 'vue-router',
- '@vueuse/core',
- ],
- dts: true,
- dirs: [
- './src/composables',
- ],
- vueTemplate: true,
- resolvers: [ElementPlusResolver()],
- }),
- // https://github.com/antfu/vite-plugin-components
- Components({
- dts: true,
- resolvers: [ElementPlusResolver(), IconsResolver()],
- }),
- // https://github.com/antfu/unocss
- // see uno.config.ts for config
- UnoCSS(),
- Icons({
- compiler: 'vue3',
- autoInstall: true,
- }),
- ],
- // https://github.com/vitest-dev/vitest
- test: {
- environment: 'jsdom',
- },
- })
|