From 4af8edf58baf49587acf29cb7dd2a917fd115346 Mon Sep 17 00:00:00 2001 From: RainbowBird Date: Sun, 14 Dec 2025 20:30:31 +0800 Subject: [PATCH] chore(CI): upload sourcemap to posthog --- .github/workflows/deploy-cloudflare-workers.yml | 6 ++++++ apps/stage-web/vite.config.ts | 3 +++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/deploy-cloudflare-workers.yml b/.github/workflows/deploy-cloudflare-workers.yml index cb3835c83..2b48da8ea 100644 --- a/.github/workflows/deploy-cloudflare-workers.yml +++ b/.github/workflows/deploy-cloudflare-workers.yml @@ -77,6 +77,12 @@ jobs: S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} S3_REGION: ${{ secrets.S3_REGION }} WARP_DRIVE_PUBLIC_BASE: ${{ secrets.WARP_DRIVE_PUBLIC_BASE }} + - name: Inject & upload source maps to PostHog + uses: PostHog/upload-source-maps@v0.4.6 + with: + directory: ${{ matrix.dist_directory }} + env-id: ${{ secrets.POSTHOG_ENV_ID }} + cli-token: ${{ secrets.POSTHOG_TOKEN }} - uses: cloudflare/wrangler-action@v3 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} diff --git a/apps/stage-web/vite.config.ts b/apps/stage-web/vite.config.ts index b3a626624..c2b9b3681 100644 --- a/apps/stage-web/vite.config.ts +++ b/apps/stage-web/vite.config.ts @@ -67,6 +67,9 @@ export default defineConfig({ ], }, }, + build: { + sourcemap: true, + }, plugins: [ Info(),