Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions frontend/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { sentrySvelteKit } from "@sentry/sveltekit";
import tailwindcss from '@tailwindcss/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { defineConfig, loadEnv } from 'vite';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'import' is only available in ES6 (use 'esversion: 6').


export default defineConfig({
plugins: [sentrySvelteKit({
org: "micropyramid-fa",
project: "bottlecrm-app",
autoUploadSourceMaps: !!process.env.PUBLIC_SENTRY_DSN
}), tailwindcss(), sveltekit()],
optimizeDeps: {
exclude: ['esm-env']
}
});
export default defineConfig(({ mode }) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

const env = loadEnv(mode, process.cwd(), '');
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

loadEnv(mode, process.cwd(), '') makes the env file lookup dependent on the current working directory. In a monorepo/CI this can end up loading /.env* from the repo root instead of frontend/.env*, causing Sentry upload config to silently differ across environments. Consider resolving envDir relative to this config file (e.g., via new URL('.', import.meta.url) + fileURLToPath) so env loading is stable regardless of where the command is invoked from.

Copilot uses AI. Check for mistakes.
return {
plugins: [sentrySvelteKit({
org: "micropyramid-fa",
project: "bottlecrm-app",
Comment on lines +10 to +11
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The PR description/title indicates Sentry source map upload configuration is environment-variable driven, but org and project are still hard-coded here. Either move these to env vars as well (so builds across forks/staging can configure without code changes) or adjust the PR description to reflect that only the auth token/enablement is env-configured.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

This introduces a dependency on SENTRY_AUTH_TOKEN, but that variable isn't documented anywhere in the frontend setup docs/templates (e.g., frontend/.env.example). Please add it (commented) to the relevant env template or documentation so deploy/CI configuration is discoverable.

Suggested change
project: "bottlecrm-app",
project: "bottlecrm-app",
// SENTRY_AUTH_TOKEN is required for uploading source maps to Sentry.
// Ensure this is set in your environment and documented in the frontend env template (e.g. .env.example)

Copilot uses AI. Check for mistakes.
sourceMapsUploadOptions: {
authToken: env.SENTRY_AUTH_TOKEN
},
autoUploadSourceMaps: !!env.PUBLIC_SENTRY_DSN
}), tailwindcss(), sveltekit()],
optimizeDeps: {
exclude: ['esm-env']
}
};
});
Loading