Skip to content

Commit

Permalink
always have a default force exclude
Browse files Browse the repository at this point in the history
  • Loading branch information
cnuss committed Nov 24, 2023
1 parent 6d4f167 commit 6a2ee20
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@ function applyUserConfig(config, userConfig, servicePath, runtime) {
const runtimeVersion =
Number.parseInt((runtime || "").replace("nodejs", ""), 10) || 12;

// Exclude aws-sdk from default if runtime >= 18
const forceExclude = config.options.forceExclude.filter(
(item) => !(runtimeVersion >= 18 && item === "aws-sdk")
);

// Concat forceExclude if provided
if (userConfig.forceExclude) {
userConfig.forceExclude = config.options.forceExclude
.filter((item) => !(runtimeVersion >= 18 && item === "aws-sdk"))
.concat(userConfig.forceExclude);
userConfig.forceExclude = forceExclude.concat(userConfig.forceExclude);
} else {
userConfig.forceExclude = forceExclude;
}

// Concat externals if a list of packages are provided
Expand Down

0 comments on commit 6a2ee20

Please sign in to comment.