Skip to content

Commit

Permalink
fix(vite): add configured headers for devtool-related response (#710)
Browse files Browse the repository at this point in the history
  • Loading branch information
nighca authored Jan 1, 2025
1 parent c823a87 commit e758ac3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/vite/src/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ export default function VitePluginVueDevTools(options?: VitePluginVueDevToolsOpt
server.middlewares.use(`${base}__devtools__`, sirv(DIR_CLIENT, {
single: true,
dev: true,
setHeaders(response) {
if (config.server.headers == null)
return
Object.entries(config.server.headers).forEach(([key, value]) => {
if (value == null)
return
response.setHeader(key, value)
})
},
}))

// vite client <-> server messaging
Expand Down

0 comments on commit e758ac3

Please sign in to comment.