fix: do not override snowpack alias (#610)

This commit is contained in:
Nate Moore 2021-07-07 14:53:00 -05:00 committed by GitHub
parent 5d5d67c8f9
commit 20b4a600f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Bugfix: do not override user `alias` passed into snowpack config

View file

@ -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(