Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions docs/assets/index-DGk7pXXG.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/assets/index-PJVMgmca.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Smart-Form Navigator</title>
<script type="module" crossorigin src="/smartforms/assets/index-DGk7pXXG.js"></script>
<link rel="stylesheet" crossorigin href="/smartforms/assets/index-PJVMgmca.css">
</head>

<body class="bg-gray-50">
<div id="root"></div>

<!-- Vite injects HMR & bundles here -->
</body>
</html>
37 changes: 27 additions & 10 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,53 @@
// frontend/vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';

/* All packages that must stay on the server side */
/* all the server‑only modules you stubbed out */
const NODE_ONLY = [
'playwright',
'playwright-core',
'chromium-bidi'
];

export default defineConfig({
plugins: [react()],
// ─────────────── PUBLIC PATH ────────────────
// when you build, assets will be referenced under /smartforms/
base: '/smartforms/',

plugins: [
react(),
],

server: {
host: '0.0.0.0',
port: 5173,
proxy: { '/api': 'http://localhost:4000' } // API → backend
// ← This proxy lets your dev frontend at :5173 call `/api/...`
// and have it forwarded to your backend at localhost:4000
proxy: {
'/api': {
target: 'http://localhost:4000',
changeOrigin: true,
secure: false,
},
},
},

/* ------------- prevent them from entering the browser bundle ------------- */
optimizeDeps: {
exclude: NODE_ONLY
exclude: NODE_ONLY,
},

build: {
rollupOptions: {
external: NODE_ONLY
}
external: NODE_ONLY,
},
},

resolve: {
alias: NODE_ONLY.reduce((acc, name) => {
acc[name] = resolve(__dirname, 'stub.js'); // map to empty stub
// stub these out so Vite's build doesn't choke
acc[name] = resolve(__dirname, 'stub.js');
return acc;
}, {} as Record<string, string>)
}
}, {} as Record<string,string>),
},
});
Loading