Skip to content

Commit

Permalink
fix: 兼容 Windows os
Browse files Browse the repository at this point in the history
  • Loading branch information
c0dedance committed Oct 13, 2023
1 parent 695af3a commit 19fa090
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/node/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import path from 'path'
import { pathToFileURL } from 'url';
import { build as viteBuild } from 'vite'
import fs from "fs-extra";
// import ora from 'ora'
Expand All @@ -12,7 +13,7 @@ export async function build(root: string = process.cwd()) {
// 1. bundle client 端 + server 端
const [clientBundle, serverBundle] = await bundle(root);
// 2. 引入 server-entry 模块
const serverEntryPath = path.resolve(root, './.temp/ssr-entry.js')
const serverEntryPath = pathToFileURL(path.resolve(root, './.temp/ssr-entry.js')).toString()
const { render } = await import(serverEntryPath)
// 3. 服务端渲染,产出HTML
await renderPage(root, render, clientBundle)
Expand Down

0 comments on commit 19fa090

Please sign in to comment.