|
@@ -2,7 +2,7 @@ import { defineConfig, loadEnv } from 'vite'
|
|
|
import path from 'path'
|
|
|
import createVitePlugins from './vite/plugins'
|
|
|
import tailwindcss from 'tailwindcss'
|
|
|
-
|
|
|
+import { sentryVitePlugin } from '@sentry/vite-plugin'
|
|
|
// https://vitejs.dev/config/
|
|
|
export default defineConfig(({ mode, command }) => {
|
|
|
const env = loadEnv(mode, process.cwd())
|
|
@@ -13,7 +13,21 @@ export default defineConfig(({ mode, command }) => {
|
|
|
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
|
|
// base: VITE_APP_ENV === 'production' ? '/voiceMateWeb/' : '/',
|
|
|
base: VITE_APP_ENV === 'production' ? '/' : '/',
|
|
|
- plugins: createVitePlugins(env, command === 'build'),
|
|
|
+ plugins: [
|
|
|
+ createVitePlugins(env, command === 'build'),
|
|
|
+ sentryVitePlugin({
|
|
|
+ url: 'https://sentry.fuxicarbon.com', // 你的 Sentry 服务器地址
|
|
|
+ org: 'sentry', // 你的组织名称
|
|
|
+ project: 'test-vue', // 你的 Sentry 项目名称
|
|
|
+ release: 'sentry001', // 👈 修正格式,release 需要是 string
|
|
|
+ authToken: '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',
|
|
|
+ include: './dist', // 👈 确保匹配你的 `dist` 目录
|
|
|
+ ignore: ['node_modules', 'dist/**/*.html'], // 忽略 node_modules 和 HTML
|
|
|
+ }),
|
|
|
+ ],
|
|
|
+ build: {
|
|
|
+ sourcemap: true, // 开启 Source Map
|
|
|
+ },
|
|
|
resolve: {
|
|
|
// https://cn.vitejs.dev/config/#resolve-alias
|
|
|
alias: {
|