Skip to content

Commit

Permalink
fix(browser): serve ui assets as static
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Sep 25, 2024
1 parent 8723242 commit 9891506
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/browser/src/node/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,14 @@ export default (browserServer: BrowserServer, base = '/'): Plugin[] => {
},
{
name: 'vitest:browser:assets',
configureServer(server) {
server.middlewares.use(
'/__vitest__',
sirv(resolve(distRoot, 'client/__vitest__')),
)
},
resolveId(id) {
if (id.startsWith('/__vitest_browser__/') || id.startsWith('/__vitest__/')) {
if (id.startsWith('/__vitest_browser__/')) {
return resolve(distRoot, 'client', id.slice(1))
}
},
Expand Down

0 comments on commit 9891506

Please sign in to comment.