build(custom): 增加错误上报监控
This commit is contained in:
@@ -14,6 +14,7 @@ import viteCompression from 'vite-plugin-compression'
|
||||
import { configHtmlPlugin } from './html'
|
||||
import { configMockPlugin } from './mock'
|
||||
import unplugin from './unplugin'
|
||||
import { sentryVitePlugin } from '@sentry/vite-plugin'
|
||||
|
||||
export function createVitePlugins(viteEnv, isBuild) {
|
||||
const plugins = [vue(), ...unplugin, configHtmlPlugin(viteEnv, isBuild), Unocss()]
|
||||
@@ -36,5 +37,20 @@ export function createVitePlugins(viteEnv, isBuild) {
|
||||
)
|
||||
}
|
||||
|
||||
if (viteEnv.VITE_SENTRY) {
|
||||
plugins.push(
|
||||
sentryVitePlugin({
|
||||
authToken: process.env.SENTRY_AUTH_TOKEN,
|
||||
org: 'sentry',
|
||||
project: 'jdt-mer',
|
||||
url: 'https://w.huakk.top',
|
||||
sourcemaps: {
|
||||
ignore: ['node_modules'],
|
||||
filesToDeleteAfterUpload: ['dist/**/*.js.map'],
|
||||
},
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
return plugins
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ 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图标
|
||||
@@ -45,4 +46,11 @@ export default [
|
||||
customDomId: '__CUSTOM_SVG_ICON__',
|
||||
}),
|
||||
mkcert(),
|
||||
sentryVitePlugin({
|
||||
authToken:
|
||||
'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',
|
||||
org: 'sentry',
|
||||
project: 'jdt-mer',
|
||||
url: 'https://w.huakk.top',
|
||||
}),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user