Skip to content

Commit

Permalink
fix: don't mutate the external input array
Browse files Browse the repository at this point in the history
  • Loading branch information
Swain Molster committed Oct 9, 2024
1 parent b0de995 commit bd07265
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,15 @@ export const bundle = async ({
cwd,
includeAwsSdk = false,
artifactPrefix = '',
esbuild: { external = [], ...esbuild } = {},
esbuild = {},
}: BundleOptions) => {
const entryPoints = (typeof entries === 'string' ? [entries] : entries)
.map((pattern) => glob.sync(pattern, cwd ? { cwd } : undefined))
.flat();

// Copy the array, so that we don't mutate the input.
const external = [...(esbuild.external ?? [])];

if (!includeAwsSdk) {
/**
* Don't bundle the AWS SDK, since it is natively available
Expand Down

0 comments on commit bd07265

Please sign in to comment.