From 2ae9d37f0a9cb21ab288d3c30aecb6d84db87788 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 000000000000..0f914891dc07 --- /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 4aeb35f3a486..afd164126e73 100644 --- a/packages/astro/src/core/dev/container.ts +++ b/packages/astro/src/core/dev/container.ts @@ -52,7 +52,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.