Skip to content

Commit

Permalink
add back dev server host support (#2531)
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott authored Feb 3, 2022
1 parent 069e497 commit ef1d81e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/grumpy-chefs-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix issue where hostname was not passed to dev server
10 changes: 9 additions & 1 deletion packages/astro/src/core/dev/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ef1d81e

Please sign in to comment.