Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(browser): serve ui assets as static #6564

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(browser): serve ui assets as static
  • Loading branch information
hi-ogawa committed Sep 25, 2024
commit 9891506d96052b4019c6f02c7980ee15ce59e3f8
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
Loading