From 4a2fbc11a36beeb02617a9953012019f759b8d76 Mon Sep 17 00:00:00 2001 From: daishi Date: Fri, 27 Sep 2024 15:33:42 +0900 Subject: [PATCH 1/5] fix deno deployment plugin (but als in deno does not work anyway) --- .../src/lib/plugins/vite-plugin-deploy-deno.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/waku/src/lib/plugins/vite-plugin-deploy-deno.ts b/packages/waku/src/lib/plugins/vite-plugin-deploy-deno.ts index 88270b6d9..c032dc641 100644 --- a/packages/waku/src/lib/plugins/vite-plugin-deploy-deno.ts +++ b/packages/waku/src/lib/plugins/vite-plugin-deploy-deno.ts @@ -27,11 +27,13 @@ app.use('*', serveStatic({ root: distDir + '/' + publicDir })); app.use('*', runner({ cmd: 'start', loadEntries, env })); app.notFound(async (c) => { const file = distDir + '/' + publicDir + '/404.html'; - const info = await Deno.stat(file); - if (info.isFile) { - c.header('Content-Type', 'text/html; charset=utf-8'); - return c.body(await Deno.readFile(file), 404); - } + try { + const info = await Deno.stat(file); + if (info.isFile) { + c.header('Content-Type', 'text/html; charset=utf-8'); + return c.body(await Deno.readFile(file), 404); + } + } catch {} return c.text('404 Not Found', 404); }); @@ -72,6 +74,11 @@ export function deployDenoPlugin(opts: { config.ssr.resolve.conditions.push('worker'); config.ssr.resolve.externalConditions ||= []; config.ssr.resolve.externalConditions.push('worker'); + if (Array.isArray(config.ssr.external)) { + config.ssr.external = config.ssr.external.filter( + (item) => item !== 'hono/context-storage', + ); + } }, resolveId(source) { if (source === `${opts.srcDir}/${SERVE_JS}`) { From 066e357697f3df953d30e47ee00e60fd35bb248e Mon Sep 17 00:00:00 2001 From: daishi Date: Fri, 27 Sep 2024 16:20:25 +0900 Subject: [PATCH 2/5] fix netlify deployment plugin (but included_file does not work anyway) --- packages/waku/src/lib/plugins/vite-plugin-deploy-netlify.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/waku/src/lib/plugins/vite-plugin-deploy-netlify.ts b/packages/waku/src/lib/plugins/vite-plugin-deploy-netlify.ts index 26a2fc422..3ef427d16 100644 --- a/packages/waku/src/lib/plugins/vite-plugin-deploy-netlify.ts +++ b/packages/waku/src/lib/plugins/vite-plugin-deploy-netlify.ts @@ -66,9 +66,6 @@ export function deployNetlifyPlugin(opts: { if (source === `${opts.srcDir}/${SERVE_JS}`) { return source; } - if (source === 'hono/context-storage') { - return { id: source, external: true }; - } }, load(id) { if (id === `${opts.srcDir}/${SERVE_JS}`) { From 18af9044dbd5a287c469b07d97bc8a032ce09f73 Mon Sep 17 00:00:00 2001 From: daishi Date: Fri, 27 Sep 2024 16:21:27 +0900 Subject: [PATCH 3/5] fix vercel too --- packages/waku/src/lib/plugins/vite-plugin-deploy-vercel.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/waku/src/lib/plugins/vite-plugin-deploy-vercel.ts b/packages/waku/src/lib/plugins/vite-plugin-deploy-vercel.ts index 41813f65a..0005ebfc8 100644 --- a/packages/waku/src/lib/plugins/vite-plugin-deploy-vercel.ts +++ b/packages/waku/src/lib/plugins/vite-plugin-deploy-vercel.ts @@ -78,9 +78,6 @@ export function deployVercelPlugin(opts: { if (source === `${opts.srcDir}/${SERVE_JS}`) { return source; } - if (source === 'hono/context-storage') { - return { id: source, external: true }; - } }, load(id) { if (id === `${opts.srcDir}/${SERVE_JS}`) { From 1976eb4ec1e8cbd3871c679bb039b4c0874f03a8 Mon Sep 17 00:00:00 2001 From: daishi Date: Fri, 27 Sep 2024 16:21:59 +0900 Subject: [PATCH 4/5] testing vercel serverless --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 79a538d46..e30870e4a 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "examples:prd:24_nesting": "NAME=24_nesting pnpm run examples:prd", "website:dev": "(cd packages/website && pnpm run dev)", "website:build": "cd packages/website && pnpm run build", - "website:vercel": "pnpm run compile && pnpm run website:build --with-vercel-static && mv packages/website/.vercel/output .vercel/", + "website:vercel": "pnpm run compile && pnpm run website:build && mv packages/website/.vercel/output .vercel/", "website:prd": "pnpm run website:build && (cd packages/website && pnpm start)" }, "prettier": { From 92425446faa6af15387085259a37e5b29cf3aea5 Mon Sep 17 00:00:00 2001 From: daishi Date: Fri, 27 Sep 2024 16:39:05 +0900 Subject: [PATCH 5/5] Revert "testing vercel serverless" This reverts commit 1976eb4ec1e8cbd3871c679bb039b4c0874f03a8. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e30870e4a..79a538d46 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "examples:prd:24_nesting": "NAME=24_nesting pnpm run examples:prd", "website:dev": "(cd packages/website && pnpm run dev)", "website:build": "cd packages/website && pnpm run build", - "website:vercel": "pnpm run compile && pnpm run website:build && mv packages/website/.vercel/output .vercel/", + "website:vercel": "pnpm run compile && pnpm run website:build --with-vercel-static && mv packages/website/.vercel/output .vercel/", "website:prd": "pnpm run website:build && (cd packages/website && pnpm start)" }, "prettier": {