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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user