Skip to content

Commit

Permalink
fix(nightly): temporarily resolve spa reload issues (#1876)
Browse files Browse the repository at this point in the history
fix: reload page 404
  • Loading branch information
ErKeLost authored Oct 24, 2024
1 parent 359035e commit 2140272
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/core/src/server/middlewares/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ export function resourceMiddleware(app: Server): Connect.NextHandleFunction {
// return;
// }
// }
// TODO redefine spa mpa
let indexHtml = compiler.resources()['index.html'];

if (indexHtml) {
res.setHeader('Content-Type', 'text/html');
res.end(indexHtml);
return;
}

// 如果找不到任何匹配的资源,返回 404
res.statusCode = 404;
Expand Down

0 comments on commit 2140272

Please sign in to comment.