chore: only add sentry plugin when building from release package

This commit is contained in:
Miodec 2025-04-30 14:13:51 +02:00
parent bdaa3b16ff
commit faffc78abc
3 changed files with 17 additions and 13 deletions

View file

@ -141,15 +141,17 @@ export default {
],
},
}),
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: "monkeytype",
project: "frontend",
release: {
name: buildClientVersion(),
},
applicationKey: "monkeytype-frontend",
}),
process.env.SENTRY
? sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: "monkeytype",
project: "frontend",
release: {
name: buildClientVersion(),
},
applicationKey: "monkeytype-frontend",
})
: null,
replace([
{
filter: /firebase\.ts$/,
@ -246,7 +248,7 @@ export default {
},
],
build: {
sourcemap: true,
sourcemap: process.env.SENTRY,
emptyOutDir: true,
outDir: "../dist",
assetsInlineLimit: 0, //dont inline small files as data

View file

@ -1,5 +1,7 @@
import { execSync } from "child_process";
// idk why its failing to resolve
// eslint-disable-next-line import/no-unresolved
import { Octokit } from "@octokit/rest";
import { execSync } from "child_process";
import dotenv from "dotenv";
import fs, { readFileSync } from "fs";
import readlineSync from "readline-sync";
@ -174,7 +176,7 @@ const buildProject = () => {
}
runProjectRootCommand(
"npx turbo lint test validate-json build " + filter + " --force"
"SENTRY=1 npx turbo lint test validate-json build " + filter + " --force"
);
};

View file

@ -32,7 +32,7 @@
},
"@monkeytype/frontend#build": {
"dependsOn": ["^build"],
"env": ["BACKEND_URL", "RECAPTCHA_SITE_KEY"],
"env": ["BACKEND_URL", "RECAPTCHA_SITE_KEY", "SENTRY"],
"outputs": ["dist/**"]
},
"@monkeytype/frontend#dev": {