diff --git a/apps/evm/.env.example b/apps/evm/.env.example index 2cb8ff363..82b2c7cda 100644 --- a/apps/evm/.env.example +++ b/apps/evm/.env.example @@ -9,8 +9,6 @@ VITE_BTC_API_URL="https://btc-testnet.gobob.xyz" VITE_FEATURE_FLAG_BTC_ONRAMP=disabled VITE_INDEXER_BRIDGE_URL="" VITE_SENTRY_URL="" -VITE_SENTRY_AUTH_TOKEN="" - /* MAINNET */ VITE_ONRAMP_API_URL="https://onramp-api-mainnet.gobob.xyz" diff --git a/apps/evm/vite.config.ts b/apps/evm/vite.config.ts index 24b41633b..a5d515b71 100644 --- a/apps/evm/vite.config.ts +++ b/apps/evm/vite.config.ts @@ -6,24 +6,29 @@ import wasm from 'vite-plugin-wasm'; // https://vitejs.dev/config/ export default defineConfig(({ mode }) => { - const env = loadEnv(mode, process.cwd()); + // Load env file based on `mode` in the current working directory. + // Set the third parameter to '' to load all env regardless of the `VITE_` prefix. + const env = loadEnv(mode, process.cwd(), ''); return { + define: { + __APP_ENV__: JSON.stringify(env.APP_ENV) + }, + build: { + target: 'esnext', + sourcemap: true // Source map generation must be turned on + }, plugins: [ react(), nodePolyfills(), wasm(), sentryVitePlugin({ - applicationKey: 'bob-ui-application-key', - authToken: env.VITE_SENTRY_AUTH_TOKEN, org: 'distributed-crafts', - project: 'bob-ui' + project: 'bob-ui', + applicationKey: 'bob-ui-application-key', + authToken: process.env.SENTRY_AUTH_TOKEN }) ], - build: { - target: 'esnext', - sourcemap: true // Source map generation must be turned on - }, server: { proxy: { '/api': {