sst 2.19.2 → 2.20.1

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.19.2",
4
+ "version": "2.20.1",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },
@@ -66,7 +66,7 @@
66
66
  "cross-spawn": "^7.0.3",
67
67
  "dendriform-immer-patch-optimiser": "^2.1.0",
68
68
  "dotenv": "^16.0.3",
69
- "esbuild": "0.16.13",
69
+ "esbuild": "0.18.11",
70
70
  "express": "^4.18.2",
71
71
  "fast-jwt": "^1.6.1",
72
72
  "get-port": "^6.1.2",
@@ -26,7 +26,7 @@ export const useNodeHandler = Context.memo(async () => {
26
26
  .relative(project.paths.root, input.file)
27
27
  .split(path.sep)
28
28
  .join(path.posix.sep);
29
- return Boolean(result.metafile?.inputs[relative]);
29
+ return Boolean(result.last.metafile?.inputs[relative]);
30
30
  },
31
31
  canHandle: (input) => input.startsWith("nodejs"),
32
32
  startWorker: async (input) => {
@@ -89,9 +89,12 @@ export const useNodeHandler = Context.memo(async () => {
89
89
  .relative(input.out, target.replace(extension, parsed.ext))
90
90
  .split(path.sep)
91
91
  .join(path.posix.sep);
92
- if (exists?.rebuild) {
93
- const result = await exists.rebuild();
94
- cache[input.functionID] = result;
92
+ if (exists) {
93
+ const result = await exists.ctx.rebuild();
94
+ cache[input.functionID] = {
95
+ ctx: exists.ctx,
96
+ last: result,
97
+ };
95
98
  return {
96
99
  type: "success",
97
100
  handler,
@@ -146,7 +149,8 @@ export const useNodeHandler = Context.memo(async () => {
146
149
  ...override,
147
150
  };
148
151
  try {
149
- const result = await esbuild.build(options);
152
+ const ctx = await esbuild.context(options);
153
+ const result = await ctx.rebuild();
150
154
  // Install node_modules
151
155
  const installPackages = [
152
156
  ...(nodejs.install || []),
@@ -202,7 +206,10 @@ export const useNodeHandler = Context.memo(async () => {
202
206
  }
203
207
  catch { }
204
208
  }
205
- cache[input.functionID] = result;
209
+ cache[input.functionID] = {
210
+ ctx,
211
+ last: result,
212
+ };
206
213
  return {
207
214
  type: "success",
208
215
  handler,