Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
sarat1669 committed Sep 26, 2024
2 parents d27d460 + 37cd30f commit c872dad
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/waku/src/lib/plugins/vite-plugin-deploy-deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ const getServeJsContent = (
distPublic: string,
srcEntriesFile: string,
) => `
import { Hono } from 'https://deno.land/x/hono/mod.ts';
import { serveStatic } from 'https://deno.land/x/hono/middleware.ts';
import { Hono } from 'jsr:@hono/hono';
import { serveStatic } from 'jsr:@hono/hono/deno';
import { contextStorage } from 'jsr:@hono/hono/context-storage';
import { runner } from 'waku/unstable_hono';
const distDir = '${distDir}';
Expand All @@ -21,7 +22,7 @@ const loadEntries = () => import('${srcEntriesFile}');
const env = Deno.env.toObject();
const app = new Hono();
// app.use(contextStorage()); // Hono v4.6 is not available on deno.land
app.use(contextStorage());
app.use('*', serveStatic({ root: distDir + '/' + publicDir }));
app.use('*', runner({ cmd: 'start', loadEntries, env }));
app.notFound(async (c) => {
Expand Down Expand Up @@ -76,6 +77,9 @@ export function deployDenoPlugin(opts: {
if (source === `${opts.srcDir}/${SERVE_JS}`) {
return source;
}
if (source.startsWith('jsr:@hono/hono')) {
return { id: source, external: true };
}
},
load(id) {
if (id === `${opts.srcDir}/${SERVE_JS}`) {
Expand Down

0 comments on commit c872dad

Please sign in to comment.