Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(web): Add fixed version of Sentry vite plugin #26

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/web/package.json
Expand Up @@ -14,8 +14,8 @@
"@peated/shared": "file:../../packages/shared",
"@react-oauth/google": "^0.11.0",
"@rollup/plugin-replace": "^5.0.2",
"@sentry/react": "^7.51.0",
"@sentry/vite-plugin": "^0.7.2",
"@sentry/react": "^7.52.1",
"@sentry/vite-plugin": "^2.0.0",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/typography": "^0.5.9",
"@tanstack/react-query": "^4.29.7",
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/config.tsx
Expand Up @@ -2,10 +2,10 @@ const config = {
ENV: import.meta.env.PROD ? "production" : "development",
DEBUG: import.meta.env.DEV,
GOOGLE_CLIENT_ID: import.meta.env.VITE_GOOGLE_CLIENT_ID || "",
SENTRY_DSN: import.meta.env.VITE_SENTRY_DSN || "",
SENTRY_DSN: import.meta.env.VITE_SENTRY_DSN,
API_SERVER: import.meta.env.VITE_API_SERVER || "http://localhost:4000",

VERSION: import.meta.env.VITE_VERSION || "",
VERSION: import.meta.env.VITE_VERSION,
Comment on lines +5 to +8
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These don't need a fallback value. It's actually better if they're undefined instead. You don't want an empty string as a release value in Sentry.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

psure i did this to test local docker builds but will run this and double check everything

GITHUB_REPO: "https://github.com/dcramer/peated",
DISCORD_LINK: "https://discord.gg/d7GFPfy88Z",
};
Expand Down
32 changes: 16 additions & 16 deletions apps/web/vite.config.ts
@@ -1,4 +1,5 @@
import replace from "@rollup/plugin-replace";
import { sentryVitePlugin } from "@sentry/vite-plugin";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import type { ManifestOptions, VitePWAOptions } from "vite-plugin-pwa";
Expand Down Expand Up @@ -77,6 +78,7 @@ export default defineConfig(() => {
// issues with rolling out the frontend (aka index.html pointing to an old version that doesnt exist).
// Realistically we need push these assets to a CDN.
build: {
sourcemap: true,
rollupOptions: {
output: {
entryFileNames: `assets/[name].js`,
Expand Down Expand Up @@ -109,22 +111,20 @@ export default defineConfig(() => {
// A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should ignore. By default no files are ignored.
exclude: "",
}),
// https://github.com/getsentry/sentry-javascript/issues/8059
// sentryVitePlugin({
// org: env.SENTRY_ORG,
// project: env.SENTRY_PROJECT,

// // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
// // and need `project:releases` and `org:read` scopes
// authToken: env.SENTRY_AUTH_TOKEN,

// release: env.VERSION,

// sourcemaps: {
// // Specify the directory containing build artifacts
// assets: "./dist/**",
// },
// }),
sentryVitePlugin({
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
// and need `project:releases` and `org:read` scopes
authToken: process.env.SENTRY_AUTH_TOKEN,
release: {
name: process.env.VERSION,
},
sourcemaps: {
assets: "./dist/**",
deleteFilesAfterUpload: "./dist/**/*.map",
},
}),
replace(replaceOptions),
],
};
Expand Down
137 changes: 108 additions & 29 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.