[ENG-1072] Connect sentry with sourcemaps (#1293)

add sourcemaps
This commit is contained in:
Brendan Allan
2023-09-04 19:20:29 +08:00
committed by GitHub
parent 53828ce4d0
commit ae0f5c744e
5 changed files with 23 additions and 9 deletions

2
.gitignore vendored
View File

@@ -15,7 +15,7 @@ cli/turbo.exe
storybook-static/
.DS_Store
cache
.env
.env*
vendor/
data
node_modules

View File

@@ -19,6 +19,7 @@
"@sd/client": "workspace:*",
"@sd/interface": "workspace:*",
"@sd/ui": "workspace:*",
"@sentry/vite-plugin": "^2.7.0",
"@tanstack/react-query": "^4.24.4",
"@tauri-apps/api": "1.3.0",
"comlink": "^4.4.1",
@@ -38,8 +39,8 @@
"semver": "^7.5.0",
"typescript": "^5.0.4",
"vite": "^4.0.4",
"vite-plugin-html": "^3.2.0",
"vite-plugin-svgr": "^2.2.1",
"vite-tsconfig-paths": "^4.0.3",
"vite-plugin-html": "^3.2.0"
"vite-tsconfig-paths": "^4.0.3"
}
}

View File

@@ -1,4 +1,5 @@
import { Plugin, mergeConfig } from 'vite';
import { sentryVitePlugin } from '@sentry/vite-plugin';
import { Plugin, defineConfig, loadEnv, mergeConfig } from 'vite';
import baseConfig from '../../packages/config/vite';
const devtoolsPlugin: Plugin = {
@@ -16,9 +17,20 @@ const devtoolsPlugin: Plugin = {
}
};
export default mergeConfig(baseConfig, {
server: {
port: 8001
},
plugins: [devtoolsPlugin]
export default defineConfig(({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd(), '') };
return mergeConfig(baseConfig, {
server: {
port: 8001
},
plugins: [
devtoolsPlugin,
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'spacedriveapp',
project: 'desktop'
})
]
});
});

View File

@@ -26,6 +26,7 @@ export default defineConfig({
},
root: 'src',
build: {
sourcemap: true,
outDir: '../dist',
assetsDir: '.'
},

BIN
pnpm-lock.yaml generated
View File

Binary file not shown.