From 1f6497c3341231ee76fc4538cfe7624cf4721d56 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Thu, 17 Aug 2023 16:51:08 -0500 Subject: [PATCH] fix(dev): open to base path (#8123) --- .changeset/popular-carrots-sneeze.md | 5 +++++ packages/astro/src/core/dev/container.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/popular-carrots-sneeze.md diff --git a/.changeset/popular-carrots-sneeze.md b/.changeset/popular-carrots-sneeze.md new file mode 100644 index 0000000000..0f914891dc --- /dev/null +++ b/.changeset/popular-carrots-sneeze.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Open to configured `base` when `astro dev --open` runs diff --git a/packages/astro/src/core/dev/container.ts b/packages/astro/src/core/dev/container.ts index d4e41e96d4..b48d4c7b54 100644 --- a/packages/astro/src/core/dev/container.ts +++ b/packages/astro/src/core/dev/container.ts @@ -56,7 +56,9 @@ export async function createContainer({ settings = injectImageEndpoint(settings); } - const { host, headers, open } = settings.config.server; + const { base, server: { host, headers, open: shouldOpen }} = settings.config; + // Open server to the correct path + const open = shouldOpen ? base : false; // The client entrypoint for renderers. Since these are imported dynamically // we need to tell Vite to preoptimize them.