From 20b4a600f5bff8102ff1d7469e8c586f33d31652 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Wed, 7 Jul 2021 14:53:00 -0500 Subject: [PATCH] fix: do not override snowpack alias (#610) --- .changeset/metal-lions-try.md | 5 +++++ packages/astro/src/runtime.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/metal-lions-try.md diff --git a/.changeset/metal-lions-try.md b/.changeset/metal-lions-try.md new file mode 100644 index 000000000..c70a2f872 --- /dev/null +++ b/.changeset/metal-lions-try.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Bugfix: do not override user `alias` passed into snowpack config diff --git a/packages/astro/src/runtime.ts b/packages/astro/src/runtime.ts index a12f5d4fe..a8a322f84 100644 --- a/packages/astro/src/runtime.ts +++ b/packages/astro/src/runtime.ts @@ -422,8 +422,8 @@ async function createSnowpack(astroConfig: AstroConfig, options: CreateSnowpackO }); const polyfillNode = (snowpackConfig.packageOptions as any).polyfillNode as boolean; - if(!polyfillNode) { - snowpackConfig.alias = Object.fromEntries(nodeBuiltinsMap); + if (!polyfillNode) { + snowpackConfig.alias = Object.assign({}, Object.fromEntries(nodeBuiltinsMap), snowpackConfig.alias ?? {}); } snowpack = await startSnowpackServer(