Skip to content

Commit

Permalink
Alernate structure with vite.config.js and index.html outside of src
Browse files Browse the repository at this point in the history
  • Loading branch information
pygeek committed Sep 8, 2024
1 parent cdd7566 commit 3460378
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@
localStorage.removeItem('ogs-script');
}
</script>
<script type="module" src="/main.tsx"></script>
<script type="module" src="src/main.tsx"></script>
</body>

</html>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down
2 changes: 1 addition & 1 deletion src/server.ts → server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"experimentalDecorators": true,
"lib": ["es2015", "dom"],
"skipLibCheck": true,
"baseUrl": "src",
"baseUrl": ".",
"paths": {
"@/*": ["*"],
"@/*": ["src/*"],
},

"forceConsistentCasingInFileNames": true,
Expand Down
8 changes: 4 additions & 4 deletions src/vite.config.ts → vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit 3460378

Please sign in to comment.