diff --git a/package.json b/package.json index 338b102b..2a652dde 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "scripts": { "dev": "npm run i18n && vite dev", "build": "npm run i18n && vite build && npm run copy:workers", + "staging": "npm run i18n && vite build --mode staging && npm run copy:workers", "package": "svelte-kit sync && svelte-package", "preview": "vite preview", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", diff --git a/playwright.config.ts b/playwright.config.ts index ac74c050..e6ef616c 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -3,7 +3,7 @@ import { devices } from "@playwright/test"; const config: PlaywrightTestConfig = { webServer: { - command: "npm run build && npm run preview", + command: "npm run staging && npm run preview", port: 4173, }, testDir: "e2e", diff --git a/src/docs/services/analytics.services.ts b/src/docs/services/analytics.services.ts index 9b03586a..c54020f2 100644 --- a/src/docs/services/analytics.services.ts +++ b/src/docs/services/analytics.services.ts @@ -2,8 +2,9 @@ import { initOrbiter } from "@junobuild/analytics"; export const initAnalytics = async () => { const DEV = import.meta.env.DEV; + const STAGING = import.meta.env.MODE === "staging"; - if (DEV) { + if (DEV || STAGING) { return; }