Skip to content

Commit

Permalink
fix relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Dec 14, 2023
1 parent 054e527 commit 23341b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/waku/src/lib/builder/output-vercel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const emitVercelOutput = async (
htmlFiles: string[],
ssr: boolean,
) => {
const publicDir = path.join(rootDir, config.distDir, config.publicDir);
const outputDir = path.resolve('.vercel', 'output');
cpSync(
path.join(rootDir, config.distDir, config.publicDir),
Expand Down Expand Up @@ -72,7 +73,7 @@ export default async function handler(req, res) {
rscFiles
.filter((file) => !path.extname(file))
.map((file) => [
path.relative(outputDir, file),
path.relative(publicDir, file),
{ contentType: 'text/plain' },
]),
);
Expand All @@ -81,7 +82,7 @@ export default async function handler(req, res) {
{ src: basePrefix + '(.*)', dest: basePrefix },
...(ssr
? htmlFiles.map((htmlFile) => {
const file = config.basePath + path.relative(outputDir, htmlFile);
const file = config.basePath + path.relative(publicDir, htmlFile);
const src = file.endsWith('/' + config.indexHtml)
? file.slice(0, -('/' + config.indexHtml).length) || '/'
: file;
Expand Down

0 comments on commit 23341b7

Please sign in to comment.