sst 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,4 +23,5 @@ export declare class RemixSite extends SsrSite {
23
23
  private createServerLambdaBundle;
24
24
  protected createFunctionForRegional(): lambda.Function;
25
25
  protected createFunctionForEdge(): EdgeFunction;
26
+ private normalizeRuntime;
26
27
  }
@@ -60,7 +60,7 @@ export class RemixSite extends SsrSite {
60
60
  clientBuildVersionedSubDir: "build",
61
61
  };
62
62
  }
63
- createServerLambdaBundle(wrapperFile) {
63
+ createServerLambdaBundle(wrapperFile, external) {
64
64
  // Create a Lambda@Edge handler for the Remix server bundle.
65
65
  //
66
66
  // Note: Remix does perform their own internal ESBuild process, but it
@@ -96,7 +96,7 @@ export class RemixSite extends SsrSite {
96
96
  bundle: true,
97
97
  target: "node16",
98
98
  platform: "node",
99
- external: ["aws-sdk"],
99
+ external,
100
100
  outfile: path.join(outputPath, "server.js"),
101
101
  // We need to ensure that the polyfills are injected above other code that
102
102
  // will depend on them. Importing them within the top of the lambda code
@@ -112,8 +112,9 @@ export class RemixSite extends SsrSite {
112
112
  return outputPath;
113
113
  }
114
114
  createFunctionForRegional() {
115
- const { runtime, timeout, memorySize, environment, cdk } = this.props;
116
- const bundlePath = this.createServerLambdaBundle("regional-server.js");
115
+ const { runtime: runtimeRaw, timeout, memorySize, environment, cdk, } = this.props;
116
+ const runtime = this.normalizeRuntime(runtimeRaw);
117
+ const bundlePath = this.createServerLambdaBundle("regional-server.js", runtime === "nodejs18.x" ? [] : ["aws-sdk"]);
117
118
  return new lambda.Function(this, `ServerFunction`, {
118
119
  description: "Server handler for Remix",
119
120
  handler: "server.handler",
@@ -138,8 +139,9 @@ export class RemixSite extends SsrSite {
138
139
  });
139
140
  }
140
141
  createFunctionForEdge() {
141
- const { runtime, timeout, memorySize, permissions, environment } = this.props;
142
- const bundlePath = this.createServerLambdaBundle("edge-server.js");
142
+ const { runtime: runtimeRaw, timeout, memorySize, permissions, environment, } = this.props;
143
+ const runtime = this.normalizeRuntime(runtimeRaw);
144
+ const bundlePath = this.createServerLambdaBundle("edge-server.js", runtime === "nodejs18.x" ? [] : ["aws-sdk"]);
143
145
  return new EdgeFunction(this, `Server`, {
144
146
  scopeOverride: this,
145
147
  format: "cjs",
@@ -152,4 +154,7 @@ export class RemixSite extends SsrSite {
152
154
  environment,
153
155
  });
154
156
  }
157
+ normalizeRuntime(runtime) {
158
+ return runtime || "nodejs18.x";
159
+ }
155
160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sst",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "bin": {
5
5
  "sst": "cli/sst.js"
6
6
  },