diff --git a/packages/playground/ssr-html/server.js b/packages/playground/ssr-html/server.js
index ad115f1be01163..1f2cd5331c0157 100644
--- a/packages/playground/ssr-html/server.js
+++ b/packages/playground/ssr-html/server.js
@@ -14,6 +14,14 @@ const DYNAMIC_SCRIPTS = `
`
+const DYNAMIC_STYLES = `
+
+`
+
async function createServer(
root = process.cwd(),
isProd = process.env.NODE_ENV === 'production'
@@ -42,15 +50,30 @@ async function createServer(
// use vite's connect instance as middleware
app.use(vite.middlewares)
- app.use('*', async (req, res) => {
+ app.use('*', async (req, res, next) => {
try {
let [url] = req.originalUrl.split('?')
if (url.endsWith('/')) url += 'index.html'
+ if (url.startsWith('/favicon.ico')) {
+ return res.status(404).end('404')
+ }
+ if (url.startsWith('/@id/__x00__')) {
+ return next()
+ }
+
const htmlLoc = resolve(`.${url}`)
- let html = fs.readFileSync(htmlLoc, 'utf8')
- html = html.replace('