From df02fad13ef7c8a8a563ee3720513d437090ee2e Mon Sep 17 00:00:00 2001 From: Ben Holmes Date: Wed, 22 Jun 2022 11:38:59 -0400 Subject: [PATCH] Add `@nanostores/preact` to ALWAYS_NOEXTERNAL (#3667) * chore: add nanostores/preact to ALWAYS_NOEXTERNAL * chore: update comment to reference pR * chore: changeset --- .changeset/famous-icons-pull.md | 5 +++++ packages/astro/src/core/create-vite.ts | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/famous-icons-pull.md diff --git a/.changeset/famous-icons-pull.md b/.changeset/famous-icons-pull.md new file mode 100644 index 000000000..ffbdc851e --- /dev/null +++ b/.changeset/famous-icons-pull.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix: add @nanostores/preact to ALWAYS_NOEXTERNAL list for easier onboarding diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts index 7c447aadf..0d3e789a1 100644 --- a/packages/astro/src/core/create-vite.ts +++ b/packages/astro/src/core/create-vite.ts @@ -28,7 +28,11 @@ const ALWAYS_EXTERNAL = new Set([ 'whatwg-url', ]); const ALWAYS_NOEXTERNAL = new Set([ - 'astro', // This is only because Vite's native ESM doesn't resolve "exports" correctly. + // This is only because Vite's native ESM doesn't resolve "exports" correctly. + 'astro', + // Handle recommended nanostores. Only @nanostores/preact is required from our testing! + // Full explanation and related bug report: https://github.com/withastro/astro/pull/3667 + '@nanostores/preact', ]); // note: ssr is still an experimental API hence the type omission from `vite`