Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deployment plugins #907

Merged
merged 6 commits into from
Sep 27, 2024
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
17 changes: 12 additions & 5 deletions packages/waku/src/lib/plugins/vite-plugin-deploy-deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down Expand Up @@ -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}`) {
Expand Down
3 changes: 0 additions & 3 deletions packages/waku/src/lib/plugins/vite-plugin-deploy-netlify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`) {
Expand Down
3 changes: 0 additions & 3 deletions packages/waku/src/lib/plugins/vite-plugin-deploy-vercel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`) {
Expand Down
Loading