Skip to content

fix(preview): user vite.preview.allowedHosts in static preview#16100

Open
spider-yamet wants to merge 2 commits intowithastro:mainfrom
spider-yamet:fix/astro-preview-ignores
Open

fix(preview): user vite.preview.allowedHosts in static preview#16100
spider-yamet wants to merge 2 commits intowithastro:mainfrom
spider-yamet:fix/astro-preview-ignores

Conversation

@spider-yamet
Copy link

@spider-yamet spider-yamet commented Mar 26, 2026

Changes

  • Fixes astro preview static server to merge user Vite config from astro.config.mjs (config.vite) before starting Vite preview.

  • Keeps preview defaults/overrides on top (configFile: false, Astro-managed preview fields, Astro preview plugin).

  • Applies allowedHosts after merge to avoid Vite array-concatenation behavior.

  • Preserves precedence:

    • explicit Astro server.allowedHosts (true or non-empty array) wins
    • otherwise merged vite.preview.allowedHosts is used
  • Fixes #16088.

@changeset-bot
Copy link

changeset-bot bot commented Mar 26, 2026

⚠️ No Changeset found

Latest commit: 4332600

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Mar 26, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 26, 2026

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing spider-yamet:fix/astro-preview-ignores (4332600) with main (999c875)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (f649ae0) during the generation of this report, so 999c875 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@spider-yamet
Copy link
Author

@delucis seems current ci is failure is no assertion failures just due to timeout, I checked it from the log.
hope you can review the PR.

Thanks

image
@spider-yamet spider-yamet changed the title fix(preview): merge user vite.preview.allowedHosts in static preview fix(preview): user vite.preview.allowedHosts in static preview Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

1 participant