Skip to content

Commit

Permalink
fix(vue-server): fix ssr body tag replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Jun 23, 2024
1 parent 527f0e6 commit 88b46e2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions vue-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

https://vue-server-demo.hiro18181.workers.dev/

```sh
# local dev
pnpm i
pnpm dev

# local preview
pnpm build
pnpm preview

# deploy cloudflare
pnpm cf-build
pnpm cf-release
```

## references

- https://github.com/hi-ogawa/js-utils/pull/227
Expand Down
2 changes: 1 addition & 1 deletion vue-server/src/demo/entry-server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function handler(request: Request) {
const app = createSSRApp(Root);
const ssrHtml = await renderToString(app);
let html = (await import("virtual:index-html" as string)).default as string;
html = html.replace("<body>", () => `<div id="root">${ssrHtml}</div>`);
html = html.replace("<body>", () => `<body><div id="root">${ssrHtml}</div>`);
html = html.replace(
"<head>",
() =>
Expand Down

0 comments on commit 88b46e2

Please sign in to comment.