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
7 changes: 7 additions & 0 deletions .vercelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.env*
dist
.eve
.output
.workflow-data
*.tgz
.claude
3 changes: 2 additions & 1 deletion demo/eve-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export type EveAgentOptions = {
export function eveAgent(options: EveAgentOptions): Plugin {
return {
name: "eve-agent",
apply: "serve",
apply: (_config, { command, mode }) =>
command === "serve" && mode === "standalone",
async configureServer(server) {
const eve = await importEveHost();
const serverUrl = `http://127.0.0.1:${options.port}/`;
Expand Down
4 changes: 2 additions & 2 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "eve build && vite build"
"dev": "vite --mode standalone",
"build": "vite build"
},
"devDependencies": {
"@tailwindcss/vite": "^4.3.2",
Expand Down
24 changes: 22 additions & 2 deletions demo/vercel.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"framework": "eve",
"routes": [{ "src": "^/$", "dest": "/index.html" }]
"services": {
"web": {
"root": ".",
"framework": "vite",
"devCommand": "vite"
},
"eve": {
"root": ".",
"framework": "eve",
"buildCommand": "eve build"
}
},
"rewrites": [
{
"source": "/eve/(.*)",
"destination": { "service": "eve" }
},
{
"source": "/(.*)",
"destination": { "service": "web" }
}
]
}
25 changes: 8 additions & 17 deletions demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,21 @@ import { eveAgent } from "./eve-plugin";
const port = parseInt(process.env.PORT ?? "3000", 10);
const agentPort = 2000;

// On Vercel builds, `eve build` writes the deployment bundle to
// .vercel/output (Vercel Build Output API) and `.output/public` is never
// deployed. The static site must land in the bundle's static directory,
// where it is served ahead of the eve catch-all function. Never empty that
// directory: eve may have written assets into it already.
function resolveBuildOptions(root: string) {
if (process.env.VERCEL) {
return { outDir: `${root}/.vercel/output/static`, emptyOutDir: false };
}
return { outDir: `${root}/.output/public`, emptyOutDir: true };
}

export default defineConfig({
export default defineConfig(({ mode }) => ({
root: `${import.meta.dirname}/app`,
publicDir: `${import.meta.dirname}/public`,
build: resolveBuildOptions(import.meta.dirname),
build: { outDir: `${import.meta.dirname}/dist`, emptyOutDir: true },
server: {
port,
open: true,
proxy: { "/eve": `http://127.0.0.1:${agentPort}` },
open: mode === "standalone",
proxy:
mode === "standalone"
? { "/eve": `http://127.0.0.1:${agentPort}` }
: undefined,
},
plugins: [
tailwindcss(),
eveAgent({ root: import.meta.dirname, port: agentPort }),
],
resolve: { alias: { "@": `${import.meta.dirname}/../src` } },
});
}));
Loading