sst 2.24.2 → 2.24.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.24.2",
4
+ "version": "2.24.3",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },
@@ -112,68 +112,59 @@ export const useNodeHandler = Context.memo(async () => {
112
112
  catch { }
113
113
  }
114
114
  // Rebuilt using existing esbuild context
115
- const exists = rebuildCache[input.functionID];
116
- if (exists) {
117
- const result = await exists.ctx.rebuild();
118
- rebuildCache[input.functionID] = {
119
- ctx: exists.ctx,
120
- result,
121
- };
122
- return {
123
- type: "success",
124
- handler,
125
- };
126
- }
127
- const { external, ...override } = nodejs.esbuild || {};
115
+ let ctx = rebuildCache[input.functionID]?.ctx;
128
116
  const forceExternal = [
129
117
  "sharp",
130
118
  "pg-native",
131
119
  ...(isESM || input.props.runtime === "nodejs18.x" ? [] : ["aws-sdk"]),
132
120
  ];
133
- const options = {
134
- entryPoints: [file],
135
- platform: "node",
136
- external: [
137
- ...forceExternal,
138
- ...(nodejs.install || []),
139
- ...(external || []),
140
- ],
141
- loader: nodejs.loader,
142
- keepNames: true,
143
- bundle: true,
144
- logLevel: "silent",
145
- metafile: true,
146
- ...(isESM
147
- ? {
148
- format: "esm",
149
- target: "esnext",
150
- mainFields: ["module", "main"],
151
- banner: {
152
- js: [
153
- `import { createRequire as topLevelCreateRequire } from 'module';`,
154
- `const require = topLevelCreateRequire(import.meta.url);`,
155
- `import { fileURLToPath as topLevelFileUrlToPath, URL as topLevelURL } from "url"`,
156
- `const __dirname = topLevelFileUrlToPath(new topLevelURL(".", import.meta.url))`,
157
- nodejs.banner || "",
158
- ].join("\n"),
159
- },
160
- }
161
- : {
162
- format: "cjs",
163
- target: "node14",
164
- banner: nodejs.banner
165
- ? {
166
- js: nodejs.banner,
167
- }
168
- : undefined,
169
- }),
170
- outfile: target,
171
- sourcemap: input.mode === "start" ? "linked" : nodejs.sourcemap,
172
- minify: nodejs.minify,
173
- ...override,
174
- };
121
+ const { external, ...override } = nodejs.esbuild || {};
122
+ if (!ctx) {
123
+ const options = {
124
+ entryPoints: [file],
125
+ platform: "node",
126
+ external: [
127
+ ...forceExternal,
128
+ ...(nodejs.install || []),
129
+ ...(external || []),
130
+ ],
131
+ loader: nodejs.loader,
132
+ keepNames: true,
133
+ bundle: true,
134
+ logLevel: "silent",
135
+ metafile: true,
136
+ ...(isESM
137
+ ? {
138
+ format: "esm",
139
+ target: "esnext",
140
+ mainFields: ["module", "main"],
141
+ banner: {
142
+ js: [
143
+ `import { createRequire as topLevelCreateRequire } from 'module';`,
144
+ `const require = topLevelCreateRequire(import.meta.url);`,
145
+ `import { fileURLToPath as topLevelFileUrlToPath, URL as topLevelURL } from "url"`,
146
+ `const __dirname = topLevelFileUrlToPath(new topLevelURL(".", import.meta.url))`,
147
+ nodejs.banner || "",
148
+ ].join("\n"),
149
+ },
150
+ }
151
+ : {
152
+ format: "cjs",
153
+ target: "node14",
154
+ banner: nodejs.banner
155
+ ? {
156
+ js: nodejs.banner,
157
+ }
158
+ : undefined,
159
+ }),
160
+ outfile: target,
161
+ sourcemap: input.mode === "start" ? "linked" : nodejs.sourcemap,
162
+ minify: nodejs.minify,
163
+ ...override,
164
+ };
165
+ ctx = await esbuild.context(options);
166
+ }
175
167
  try {
176
- const ctx = await esbuild.context(options);
177
168
  const result = await ctx.rebuild();
178
169
  // Install node_modules
179
170
  const installPackages = [
package/stacks/build.js CHANGED
@@ -51,6 +51,8 @@ export async function load(input, shallow) {
51
51
  .then((x) => x.toString());
52
52
  const ast = babel.parse(contents, {
53
53
  sourceType: "module",
54
+ babelrc: false,
55
+ configFile: false,
54
56
  filename: "sst.config.ts",
55
57
  plugins: [ts],
56
58
  });