From 3460378f71b10d321a2ffcb15b569b3fe5e016c9 Mon Sep 17 00:00:00 2001 From: Clinton Christian Date: Sun, 8 Sep 2024 18:05:50 -0400 Subject: [PATCH] Alernate structure with vite.config.js and index.html outside of src --- src/index.html => index.html | 2 +- package.json | 2 +- src/server.ts => server.ts | 2 +- tsconfig.json | 4 ++-- src/vite.config.ts => vite.config.ts | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) rename src/index.html => index.html (99%) rename src/server.ts => server.ts (99%) rename src/vite.config.ts => vite.config.ts (92%) diff --git a/src/index.html b/index.html similarity index 99% rename from src/index.html rename to index.html index 4b1e82096b..db5f1c8e03 100644 --- a/src/index.html +++ b/index.html @@ -434,7 +434,7 @@ localStorage.removeItem('ogs-script'); } - + diff --git a/package.json b/package.json index 161f292730..d1079a7fd9 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "npm": ">=8.5.0" }, "scripts": { - "dev": "npx tsx src/server.ts", + "dev": "npx tsx server.ts", "prettier": "prettier --write \"src/**/*.{ts,tsx}\"", "prettier:check": "prettier --check \"src/**/*.{ts,tsx}\"", "lint": "eslint src/", diff --git a/src/server.ts b/server.ts similarity index 99% rename from src/server.ts rename to server.ts index 1ee3f4ee3c..4625d367da 100644 --- a/src/server.ts +++ b/server.ts @@ -65,7 +65,7 @@ const dev_server = express(); // ); //}); -ViteExpress.config({ viteConfigFile: "src/vite.config.ts" }); +ViteExpress.config({ viteConfigFile: "./vite.config.ts" }); ViteExpress.listen(dev_server, port, () => { console.info(`\n\n#############################################`); console.info(`## Development server started on port ${port}`); diff --git a/tsconfig.json b/tsconfig.json index 2836baeb27..44fa770cc7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,9 +12,9 @@ "experimentalDecorators": true, "lib": ["es2015", "dom"], "skipLibCheck": true, - "baseUrl": "src", + "baseUrl": ".", "paths": { - "@/*": ["*"], + "@/*": ["src/*"], }, "forceConsistentCasingInFileNames": true, diff --git a/src/vite.config.ts b/vite.config.ts similarity index 92% rename from src/vite.config.ts rename to vite.config.ts index a1dd7b77bb..0640925113 100644 --- a/src/vite.config.ts +++ b/vite.config.ts @@ -22,15 +22,15 @@ import fixReactVirtualized from "esbuild-plugin-react-virtualized"; import path from "path"; export default defineConfig({ - root: "src", + root: ".", build: { - outDir: "../dist", - manifest: "manifest.json", + outDir: "dist", + manifest: "src/manifest.json", }, plugins: [react()], resolve: { alias: { - "@": path.resolve(__dirname, "."), + "@": path.resolve(__dirname, "src"), //"@/components": path.resolve(__dirname, "./components"), //"@/views": path.resolve(__dirname, "./views"), //"": path.resolve(__dirname, "lib"),