refactor(web): move website into turbo app workspace
This commit is contained in:
parent
2664804e91
commit
b4e626a868
66 changed files with 318 additions and 298 deletions
40
apps/web/vite.config.ts
Normal file
40
apps/web/vite.config.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { fileURLToPath } from "node:url";
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { defineConfig, configDefaults } from "vitest/config";
|
||||
import type { UserConfig } from "vite";
|
||||
|
||||
export function createDevServerConfig(
|
||||
env: NodeJS.ProcessEnv = process.env,
|
||||
): UserConfig["server"] {
|
||||
const apiTarget = env.DASHBOARD_DEV_API_TARGET;
|
||||
if (!apiTarget) return undefined;
|
||||
|
||||
return {
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: apiTarget,
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react(), tailwindcss()],
|
||||
resolve: {
|
||||
alias: {
|
||||
"@dimensionlab/ui/styles.css": fileURLToPath(
|
||||
new URL("../../packages/ui/src/styles.css", import.meta.url),
|
||||
),
|
||||
"@dimensionlab/ui": fileURLToPath(
|
||||
new URL("../../packages/ui/src/index.ts", import.meta.url),
|
||||
),
|
||||
$lib: fileURLToPath(new URL("./src/lib", import.meta.url)),
|
||||
},
|
||||
},
|
||||
server: createDevServerConfig(),
|
||||
test: {
|
||||
exclude: [...configDefaults.exclude, "tests/e2e/**"],
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue