MCPcopy
hub / github.com/vitejs/vite / render

Function render

playground/ssr-wasm/src/app.js:1–21  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

1export async function render(url) {
2 switch (url) {
3 case '/':
4 return `<ul>${[
5 '/static-light',
6 '/static-heavy',
7 '/direct-add',
8 '/direct-light',
9 ]
10 .map((name) => `<li><a href="${name}">${name}</a></li>`)
11 .join('')}</ul>`
12 case '/static-light':
13 return (await import('./static-light')).render()
14 case '/static-heavy':
15 return (await import('./static-heavy')).render()
16 case '/direct-add':
17 return (await import('./direct-add')).render()
18 case '/direct-light':
19 return (await import('./direct-light')).render()
20 }
21}

Callers 1

createServerFunction · 0.50

Calls 1

renderMethod · 0.45

Tested by

no test coverage detected