46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import path from 'node:path';
|
|
import Vue from '@vitejs/plugin-vue';
|
|
import AutoImport from 'unplugin-auto-import/vite';
|
|
import Components from 'unplugin-vue-components/vite';
|
|
import Inspector from 'unplugin-vue-inspector/vite';
|
|
import VueMacros from 'unplugin-vue-macros/vite';
|
|
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
|
|
|
|
export const plugins = [
|
|
VueMacros({
|
|
defineOptions: false,
|
|
defineModels: false,
|
|
plugins: {
|
|
vue: Vue({
|
|
script: {
|
|
propsDestructure: true,
|
|
defineModel: true,
|
|
},
|
|
}),
|
|
},
|
|
}),
|
|
AutoImport({
|
|
imports: [
|
|
'vue',
|
|
'vue-router',
|
|
'@vueuse/core',
|
|
],
|
|
dts: './types/auto-imports.d.ts',
|
|
dirs: [
|
|
'./src/constant',
|
|
],
|
|
vueTemplate: true,
|
|
}),
|
|
Components({
|
|
dts: './types/components.d.ts',
|
|
}),
|
|
Inspector(),
|
|
createSvgIconsPlugin({
|
|
// 指定需要缓存的图标文件夹
|
|
// eslint-disable-next-line node/prefer-global/process
|
|
iconDirs: [path.resolve(process.cwd(), 'src/assets/icon')],
|
|
// 指定symbolId格式
|
|
symbolId: 'icon-[dir]-[name]',
|
|
}),
|
|
];
|