57 lines
1.7 KiB
JavaScript
57 lines
1.7 KiB
JavaScript
import { resolve } from 'path'
|
||
import AutoImport from 'unplugin-auto-import/vite'
|
||
import Components from 'unplugin-vue-components/vite'
|
||
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
|
||
import { FileSystemIconLoader } from 'unplugin-icons/loaders'
|
||
import IconsResolver from 'unplugin-icons/resolver'
|
||
import mkcert from 'vite-plugin-mkcert'
|
||
import { sentryVitePlugin } from '@sentry/vite-plugin'
|
||
|
||
/**
|
||
* * unplugin-icons插件,自动引入iconify图标
|
||
* usage: https://github.com/antfu/unplugin-icons
|
||
* 图标库: https://icones.js.org/
|
||
*/
|
||
import Icons from 'unplugin-icons/vite'
|
||
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
||
|
||
import { getSrcPath } from '../utils'
|
||
|
||
const customIconPath = resolve(getSrcPath(), 'assets/svg')
|
||
|
||
export default [
|
||
AutoImport({
|
||
imports: ['vue', 'vue-router'],
|
||
dts: false,
|
||
}),
|
||
Icons({
|
||
compiler: 'vue3',
|
||
customCollections: {
|
||
custom: FileSystemIconLoader(customIconPath),
|
||
},
|
||
scale: 1,
|
||
defaultClass: 'inline-block',
|
||
}),
|
||
Components({
|
||
resolvers: [
|
||
NaiveUiResolver(),
|
||
IconsResolver({ customCollections: ['custom'], componentPrefix: 'icon' }),
|
||
],
|
||
dts: false,
|
||
}),
|
||
createSvgIconsPlugin({
|
||
iconDirs: [customIconPath],
|
||
symbolId: 'icon-custom-[dir]-[name]',
|
||
inject: 'body-last',
|
||
customDomId: '__CUSTOM_SVG_ICON__',
|
||
}),
|
||
mkcert(),
|
||
sentryVitePlugin({
|
||
authToken:
|
||
'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',
|
||
org: 'sentry',
|
||
project: 'jdt-mer',
|
||
url: 'https://w.huakk.top',
|
||
}),
|
||
]
|