diff --git a/client/package.json b/client/package.json index 80ccec1..d06da2e 100644 --- a/client/package.json +++ b/client/package.json @@ -6,6 +6,7 @@ "homepage": "https://floppydoval.github.io/languageGO", "scripts": { "start": "vite", + "dev": "vite", "test": "npm run test:unit && npm run test:e2e", "test:unit": "vitest run", "test:e2e": "playwright test", @@ -13,7 +14,7 @@ "serve": "vite preview", "predeploy": "npm run build", "deploy": "gh-pages -d build" - }, + }, "dependencies": { "@clerk/clerk-react": "^5.17.1", "@clerk/testing": "^1.3.22", diff --git a/client/vite.config.ts b/client/vite.config.ts index e71d366..a2e6328 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -4,6 +4,8 @@ import { defineConfig, loadEnv } from "vite"; export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd(), ""); + const isProduction = mode === "production"; + return { build: { outDir: "build", @@ -13,27 +15,24 @@ export default defineConfig(({ mode }) => { "process.env.AUTH_DOMAIN": JSON.stringify(env.AUTH_DOMAIN), "process.env.PROJECT_ID": JSON.stringify(env.PROJECT_ID), "process.env.STORAGE_BUCKET": JSON.stringify(env.STORAGE_BUCKET), - "process.env.MESSAGING_SENDER_ID": JSON.stringify( - env.MESSAGING_SENDER_ID - ), + "process.env.MESSAGING_SENDER_ID": JSON.stringify(env.MESSAGING_SENDER_ID), "process.env.APP_ID": JSON.stringify(env.APP_ID), "process.env.MEASUREMENT_ID": JSON.stringify(env.MEASUREMENT_ID), "process.env.MAPBOX_TOKEN": JSON.stringify(env.MAPBOX_TOKEN), - "process.env.VITE_CLERK_PUBLISHABLE_KEY": JSON.stringify( - env.VITE_CLERK_PUBLISHABLE_KEY - ), + "process.env.VITE_CLERK_PUBLISHABLE_KEY": JSON.stringify(env.VITE_CLERK_PUBLISHABLE_KEY), }, plugins: [react()], + base: isProduction ? "/languageGO/" : "/", // Dynamically set base for GitHub Pages server: { port: 8000, }, css: { modules: { - generateScopedName: "[name]__[local]___[hash:base64:5]", // Custom class naming pattern + generateScopedName: "[name]__[local]___[hash:base64:5]", }, }, test: { exclude: ["**/e2e/**", "**/node_modules/**"], }, }; -}); \ No newline at end of file +});