From c6fd1df695d0f2a24bb49e6954064f92664ccf67 Mon Sep 17 00:00:00 2001 From: Louis Escher <66965600+louisescher@users.noreply.github.com> Date: Wed, 9 Oct 2024 12:12:22 +0200 Subject: [PATCH] Fix mts reloads (#12160) * Add mts file extension to configRE regex * Add changeset * Apply suggestions from code review Co-authored-by: Bjorn Lu --------- Co-authored-by: Emanuele Stoppa Co-authored-by: Bjorn Lu --- .changeset/mean-bags-shave.md | 5 +++++ packages/astro/src/core/dev/restart.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/mean-bags-shave.md diff --git a/.changeset/mean-bags-shave.md b/.changeset/mean-bags-shave.md new file mode 100644 index 000000000000..88263fa05ec8 --- /dev/null +++ b/.changeset/mean-bags-shave.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes a bug where `astro.config.mts` and `astro.config.cts` weren't reloading the dev server upon modifications. diff --git a/packages/astro/src/core/dev/restart.ts b/packages/astro/src/core/dev/restart.ts index 30821362c744..b7eab38af66b 100644 --- a/packages/astro/src/core/dev/restart.ts +++ b/packages/astro/src/core/dev/restart.ts @@ -30,7 +30,7 @@ async function createRestartedContainer( return newContainer; } -const configRE = /.*astro.config.(?:mjs|cjs|js|ts)$/; +const configRE = /.*astro.config.(?:mjs|mts|cjs|cts|js|ts)$/; function shouldRestartContainer( { settings, inlineConfig, restartInFlight }: Container,