add back dev server host support (#2531)
This commit is contained in:
parent
069e497a74
commit
ef1d81effd
2 changed files with 14 additions and 1 deletions
5
.changeset/grumpy-chefs-judge.md
Normal file
5
.changeset/grumpy-chefs-judge.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fix issue where hostname was not passed to dev server
|
|
@ -24,7 +24,15 @@ export default async function dev(config: AstroConfig, options: DevOptions = { l
|
|||
exclude: 'window document',
|
||||
});
|
||||
// start the server
|
||||
const viteUserConfig = vite.mergeConfig({ mode: 'development' }, config.vite || {});
|
||||
const viteUserConfig = vite.mergeConfig(
|
||||
{
|
||||
mode: 'development',
|
||||
server: {
|
||||
host: config.devOptions.hostname,
|
||||
},
|
||||
},
|
||||
config.vite || {}
|
||||
);
|
||||
const viteConfig = await createVite(viteUserConfig, { astroConfig: config, logging: options.logging });
|
||||
const viteServer = await vite.createServer(viteConfig);
|
||||
await viteServer.listen(config.devOptions.port);
|
||||
|
|
Loading…
Reference in a new issue