Skip to content

Commit b1fc98c

Browse files
committed
remove aws-sdk from default config
1 parent 6a2ee20 commit b1fc98c

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ function applyUserConfig(config, userConfig, servicePath, runtime) {
4747
const runtimeVersion =
4848
Number.parseInt((runtime || "").replace("nodejs", ""), 10) || 12;
4949

50-
// Exclude aws-sdk from default if runtime >= 18
51-
const forceExclude = config.options.forceExclude.filter(
52-
(item) => !(runtimeVersion >= 18 && item === "aws-sdk")
53-
);
50+
// Force exclude aws-sdk for versions below Node 18
51+
if (runtimeVersion < 18) {
52+
config.options.forceExclude.push("aws-sdk");
53+
}
5454

5555
// Concat forceExclude if provided
5656
if (userConfig.forceExclude) {
57-
userConfig.forceExclude = forceExclude.concat(userConfig.forceExclude);
58-
} else {
59-
userConfig.forceExclude = forceExclude;
57+
userConfig.forceExclude = config.options.forceExclude.concat(
58+
userConfig.forceExclude
59+
);
6060
}
6161

6262
// Concat externals if a list of packages are provided

src/config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ module.exports = {
2020
packagerOptions: {},
2121
generateStatsFiles: false,
2222
tsConfig: "tsconfig.json",
23-
// Exclude aws-sdk since it's available in the Lambda runtime (< nodejs18.x)
24-
forceExclude: ["aws-sdk"],
23+
forceExclude: [],
2524
disableForkTsChecker: false,
2625
// Set non Webpack compatible packages as externals
2726
// Or if we want to exclude all packages in the node_modules:

0 commit comments

Comments
 (0)