@vercel/build-utils 2.12.3-canary.31 → 2.12.3-canary.35

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.
@@ -77,6 +77,8 @@ function convertRuntimeToPlugin(buildRuntime, packageName, ext) {
77
77
  // need to be able to easily inspect the output.
78
78
  `api-routes-${pluginName}`);
79
79
  await fs_extra_1.default.ensureDir(traceDir);
80
+ let newPathsRuntime = new Set();
81
+ let linkersRuntime = [];
80
82
  for (const entrypoint of Object.keys(entrypoints)) {
81
83
  const { output } = await buildRuntime({
82
84
  files: sourceFilesPreBuild,
@@ -96,22 +98,6 @@ function convertRuntimeToPlugin(buildRuntime, packageName, ext) {
96
98
  // so we don't want to pollute this space unnecessarily. That means we have to clean
97
99
  // up files that were created by the build, which is done further below.
98
100
  const sourceFilesAfterBuild = await getSourceFiles(workPath, ignoreFilter);
99
- // Further down, we will need the filename of the Lambda handler
100
- // for placing it inside `server/pages/api`, but because Legacy Runtimes
101
- // don't expose the filename directly, we have to construct it
102
- // from the handler name, and then find the matching file further below,
103
- // because we don't yet know its extension here.
104
- const handler = output.handler;
105
- const handlerMethod = handler.split('.').reverse()[0];
106
- const handlerFileName = handler.replace(`.${handlerMethod}`, '');
107
- pages[entrypoint] = {
108
- handler: handler,
109
- runtime: output.runtime,
110
- memory: output.memory,
111
- maxDuration: output.maxDuration,
112
- environment: output.environment,
113
- allowQuery: output.allowQuery,
114
- };
115
101
  // @ts-ignore This symbol is a private API
116
102
  const lambdaFiles = output[lambda_1.FILES_SYMBOL];
117
103
  // When deploying, the `files` that are passed to the Legacy Runtimes already
@@ -123,56 +109,173 @@ function convertRuntimeToPlugin(buildRuntime, packageName, ext) {
123
109
  delete lambdaFiles[file];
124
110
  }
125
111
  }
126
- const handlerFilePath = Object.keys(lambdaFiles).find(item => {
127
- return path_1.parse(item).name === handlerFileName;
128
- });
129
- const handlerFileOrigin = lambdaFiles[handlerFilePath || ''].fsPath;
130
- if (!handlerFileOrigin) {
131
- throw new Error(`Could not find a handler file. Please ensure that the list of \`files\` defined for the returned \`Lambda\` contains a file with the name ${handlerFileName} (+ any extension).`);
112
+ let handlerFileBase = output.handler;
113
+ let handlerFile = lambdaFiles[handlerFileBase];
114
+ const { handler } = output;
115
+ const handlerMethod = handler.split('.').pop();
116
+ const handlerFileName = handler.replace(`.${handlerMethod}`, '');
117
+ // For compiled languages, the launcher file for the Lambda generated
118
+ // by the Legacy Runtime matches the `handler` defined for it, but for
119
+ // interpreted languages, the `handler` consists of the launcher file name
120
+ // without an extension, plus the name of the method inside of that file
121
+ // that should be invoked, so we have to construct the file path explicitly.
122
+ if (!handlerFile) {
123
+ handlerFileBase = handlerFileName + ext;
124
+ handlerFile = lambdaFiles[handlerFileBase];
132
125
  }
133
- const entry = path_1.join(workPath, '.output', 'server', 'pages', entrypoint);
126
+ if (!handlerFile || !handlerFile.fsPath) {
127
+ throw new Error(`Could not find a handler file. Please ensure that \`files\` for the returned \`Lambda\` contains an \`FileFsRef\` named "${handlerFileBase}" with a valid \`fsPath\`.`);
128
+ }
129
+ const handlerExtName = path_1.extname(handlerFile.fsPath);
130
+ const entryRoot = path_1.join(workPath, '.output', 'server', 'pages');
131
+ const entryBase = path_1.basename(entrypoint).replace(ext, handlerExtName);
132
+ const entryPath = path_1.join(path_1.dirname(entrypoint), entryBase);
133
+ const entry = path_1.join(entryRoot, entryPath);
134
+ // We never want to link here, only copy, because the launcher
135
+ // file often has the same name for every entrypoint, which means that
136
+ // every build for every entrypoint overwrites the launcher of the previous
137
+ // one, so linking would end with a broken reference.
134
138
  await fs_extra_1.default.ensureDir(path_1.dirname(entry));
135
- await linkOrCopy(handlerFileOrigin, entry);
136
- const toRemove = [];
137
- // You can find more details about this at the point where the
138
- // `sourceFilesAfterBuild` is created originally.
139
+ await fs_extra_1.default.copy(handlerFile.fsPath, entry);
140
+ const newFilesEntrypoint = [];
141
+ const newDirectoriesEntrypoint = [];
142
+ const preBuildFiles = Object.values(sourceFilesPreBuild).map(file => {
143
+ return file.fsPath;
144
+ });
145
+ // Generate a list of directories and files that weren't present
146
+ // before the entrypoint was processed by the Legacy Runtime, so
147
+ // that we can perform a cleanup later. We need to divide into files
148
+ // and directories because only cleaning up files might leave empty
149
+ // directories, and listing directories separately also speeds up the
150
+ // build because we can just delete them, which wipes all of their nested
151
+ // paths, instead of iterating through all files that should be deleted.
139
152
  for (const file in sourceFilesAfterBuild) {
140
153
  if (!sourceFilesPreBuild[file]) {
141
154
  const path = sourceFilesAfterBuild[file].fsPath;
142
- toRemove.push(fs_extra_1.default.remove(path));
155
+ const dirPath = path_1.dirname(path);
156
+ // If none of the files that were present before the entrypoint
157
+ // was processed are contained within the directory we're looking
158
+ // at right now, then we know it's a newly added directory
159
+ // and it can therefore be removed later on.
160
+ const isNewDir = !preBuildFiles.some(filePath => {
161
+ return path_1.dirname(filePath).startsWith(dirPath);
162
+ });
163
+ // Check out the list of tracked directories that were
164
+ // newly added and see if one of them contains the path
165
+ // we're looking at.
166
+ const hasParentDir = newDirectoriesEntrypoint.some(dir => {
167
+ return path.startsWith(dir);
168
+ });
169
+ // If we have already tracked a directory that was newly
170
+ // added that sits above the file or directory that we're
171
+ // looking at, we don't need to add more entries to the list
172
+ // because when the parent will get removed in the future,
173
+ // all of its children (and therefore the path we're looking at)
174
+ // will automatically get removed anyways.
175
+ if (hasParentDir) {
176
+ continue;
177
+ }
178
+ if (isNewDir) {
179
+ newDirectoriesEntrypoint.push(dirPath);
180
+ }
181
+ else {
182
+ newFilesEntrypoint.push(path);
183
+ }
143
184
  }
144
185
  }
145
- await Promise.all(toRemove);
146
186
  const tracedFiles = [];
147
- Object.entries(lambdaFiles).forEach(async ([relPath, file]) => {
187
+ const linkers = Object.entries(lambdaFiles).map(async ([relPath, file]) => {
148
188
  const newPath = path_1.join(traceDir, relPath);
149
189
  // The handler was already moved into position above.
150
- if (relPath === handlerFilePath) {
190
+ if (relPath === handlerFileBase) {
151
191
  return;
152
192
  }
153
193
  tracedFiles.push({ absolutePath: newPath, relativePath: relPath });
154
- if (file.fsPath) {
155
- await linkOrCopy(file.fsPath, newPath);
194
+ const { fsPath, type } = file;
195
+ if (fsPath) {
196
+ await fs_extra_1.default.ensureDir(path_1.dirname(newPath));
197
+ const isNewFile = newFilesEntrypoint.includes(fsPath);
198
+ const isInsideNewDirectory = newDirectoriesEntrypoint.some(dirPath => {
199
+ return fsPath.startsWith(dirPath);
200
+ });
201
+ // With this, we're making sure that files in the `workPath` that existed
202
+ // before the Legacy Runtime was invoked (source files) are linked from
203
+ // `.output` instead of copying there (the latter only happens if linking fails),
204
+ // which is the fastest solution. However, files that are created fresh
205
+ // by the Legacy Runtimes are always copied, because their link destinations
206
+ // are likely to be overwritten every time an entrypoint is processed by
207
+ // the Legacy Runtime. This is likely to overwrite the destination on subsequent
208
+ // runs, but that's also how `workPath` used to work originally, without
209
+ // the File System API (meaning that there was one `workPath` for all entrypoints).
210
+ if (isNewFile || isInsideNewDirectory) {
211
+ _1.debug(`Copying from ${fsPath} to ${newPath}`);
212
+ await fs_extra_1.default.copy(fsPath, newPath);
213
+ }
214
+ else {
215
+ await linkOrCopy(fsPath, newPath);
216
+ }
156
217
  }
157
- else if (file.type === 'FileBlob') {
218
+ else if (type === 'FileBlob') {
158
219
  const { data, mode } = file;
159
220
  await fs_extra_1.default.writeFile(newPath, data, { mode });
160
221
  }
161
222
  else {
162
- throw new Error(`Unknown file type: ${file.type}`);
223
+ throw new Error(`Unknown file type: ${type}`);
163
224
  }
164
225
  });
165
- const nft = path_1.join(workPath, '.output', 'server', 'pages', `${entrypoint}.nft.json`);
226
+ linkersRuntime = linkersRuntime.concat(linkers);
227
+ const nft = `${entry}.nft.json`;
166
228
  const json = JSON.stringify({
167
229
  version: 1,
168
230
  files: tracedFiles.map(file => ({
169
- input: normalize_path_1.normalizePath(path_1.relative(nft, file.absolutePath)),
231
+ input: normalize_path_1.normalizePath(path_1.relative(path_1.dirname(nft), file.absolutePath)),
170
232
  output: normalize_path_1.normalizePath(file.relativePath),
171
233
  })),
172
234
  });
173
235
  await fs_extra_1.default.ensureDir(path_1.dirname(nft));
174
236
  await fs_extra_1.default.writeFile(nft, json);
237
+ // Extend the list of directories and files that were created by the
238
+ // Legacy Runtime with the list of directories and files that were
239
+ // created for the entrypoint that was just processed above.
240
+ newPathsRuntime = new Set([
241
+ ...newPathsRuntime,
242
+ ...newFilesEntrypoint,
243
+ ...newDirectoriesEntrypoint,
244
+ ]);
245
+ // Add an entry that will later on be added to the `functions-manifest.json`
246
+ // file that is placed inside of the `.output` directory.
247
+ pages[normalize_path_1.normalizePath(entryPath)] = {
248
+ // Because the underlying file used as a handler was placed
249
+ // inside `.output/server/pages/api`, it no longer has the name it originally
250
+ // had and is now named after the API Route that it's responsible for,
251
+ // so we have to adjust the name of the Lambda handler accordingly.
252
+ handler: handler.replace(handlerFileName, path_1.parse(entry).name),
253
+ runtime: output.runtime,
254
+ memory: output.memory,
255
+ maxDuration: output.maxDuration,
256
+ environment: output.environment,
257
+ allowQuery: output.allowQuery,
258
+ };
175
259
  }
260
+ // Instead of of waiting for all of the linking to be done for every
261
+ // entrypoint before processing the next one, we immediately handle all
262
+ // of them one after the other, while then waiting for the linking
263
+ // to finish right here, before we clean up newly created files below.
264
+ await Promise.all(linkersRuntime);
265
+ // A list of all the files that were created by the Legacy Runtime,
266
+ // which we'd like to remove from the File System.
267
+ const toRemove = Array.from(newPathsRuntime).map(path => {
268
+ _1.debug(`Removing ${path} as part of cleanup`);
269
+ return fs_extra_1.default.remove(path);
270
+ });
271
+ // Once all the entrypoints have been processed, we'd like to
272
+ // remove all the files from `workPath` that originally weren't present
273
+ // before the Legacy Runtime began running, because the `workPath`
274
+ // is nowadays the directory in which the user keeps their source code, since
275
+ // we're no longer running separate parallel builds for every Legacy Runtime.
276
+ await Promise.all(toRemove);
277
+ // Add any Serverless Functions that were exposed by the Legacy Runtime
278
+ // to the `functions-manifest.json` file provided in `.output`.
176
279
  await updateFunctionsManifest({ workPath, pages });
177
280
  };
178
281
  }
package/dist/index.js CHANGED
@@ -32824,6 +32824,8 @@ function convertRuntimeToPlugin(buildRuntime, packageName, ext) {
32824
32824
  // need to be able to easily inspect the output.
32825
32825
  `api-routes-${pluginName}`);
32826
32826
  await fs_extra_1.default.ensureDir(traceDir);
32827
+ let newPathsRuntime = new Set();
32828
+ let linkersRuntime = [];
32827
32829
  for (const entrypoint of Object.keys(entrypoints)) {
32828
32830
  const { output } = await buildRuntime({
32829
32831
  files: sourceFilesPreBuild,
@@ -32843,22 +32845,6 @@ function convertRuntimeToPlugin(buildRuntime, packageName, ext) {
32843
32845
  // so we don't want to pollute this space unnecessarily. That means we have to clean
32844
32846
  // up files that were created by the build, which is done further below.
32845
32847
  const sourceFilesAfterBuild = await getSourceFiles(workPath, ignoreFilter);
32846
- // Further down, we will need the filename of the Lambda handler
32847
- // for placing it inside `server/pages/api`, but because Legacy Runtimes
32848
- // don't expose the filename directly, we have to construct it
32849
- // from the handler name, and then find the matching file further below,
32850
- // because we don't yet know its extension here.
32851
- const handler = output.handler;
32852
- const handlerMethod = handler.split('.').reverse()[0];
32853
- const handlerFileName = handler.replace(`.${handlerMethod}`, '');
32854
- pages[entrypoint] = {
32855
- handler: handler,
32856
- runtime: output.runtime,
32857
- memory: output.memory,
32858
- maxDuration: output.maxDuration,
32859
- environment: output.environment,
32860
- allowQuery: output.allowQuery,
32861
- };
32862
32848
  // @ts-ignore This symbol is a private API
32863
32849
  const lambdaFiles = output[lambda_1.FILES_SYMBOL];
32864
32850
  // When deploying, the `files` that are passed to the Legacy Runtimes already
@@ -32870,56 +32856,173 @@ function convertRuntimeToPlugin(buildRuntime, packageName, ext) {
32870
32856
  delete lambdaFiles[file];
32871
32857
  }
32872
32858
  }
32873
- const handlerFilePath = Object.keys(lambdaFiles).find(item => {
32874
- return path_1.parse(item).name === handlerFileName;
32875
- });
32876
- const handlerFileOrigin = lambdaFiles[handlerFilePath || ''].fsPath;
32877
- if (!handlerFileOrigin) {
32878
- throw new Error(`Could not find a handler file. Please ensure that the list of \`files\` defined for the returned \`Lambda\` contains a file with the name ${handlerFileName} (+ any extension).`);
32859
+ let handlerFileBase = output.handler;
32860
+ let handlerFile = lambdaFiles[handlerFileBase];
32861
+ const { handler } = output;
32862
+ const handlerMethod = handler.split('.').pop();
32863
+ const handlerFileName = handler.replace(`.${handlerMethod}`, '');
32864
+ // For compiled languages, the launcher file for the Lambda generated
32865
+ // by the Legacy Runtime matches the `handler` defined for it, but for
32866
+ // interpreted languages, the `handler` consists of the launcher file name
32867
+ // without an extension, plus the name of the method inside of that file
32868
+ // that should be invoked, so we have to construct the file path explicitly.
32869
+ if (!handlerFile) {
32870
+ handlerFileBase = handlerFileName + ext;
32871
+ handlerFile = lambdaFiles[handlerFileBase];
32879
32872
  }
32880
- const entry = path_1.join(workPath, '.output', 'server', 'pages', entrypoint);
32873
+ if (!handlerFile || !handlerFile.fsPath) {
32874
+ throw new Error(`Could not find a handler file. Please ensure that \`files\` for the returned \`Lambda\` contains an \`FileFsRef\` named "${handlerFileBase}" with a valid \`fsPath\`.`);
32875
+ }
32876
+ const handlerExtName = path_1.extname(handlerFile.fsPath);
32877
+ const entryRoot = path_1.join(workPath, '.output', 'server', 'pages');
32878
+ const entryBase = path_1.basename(entrypoint).replace(ext, handlerExtName);
32879
+ const entryPath = path_1.join(path_1.dirname(entrypoint), entryBase);
32880
+ const entry = path_1.join(entryRoot, entryPath);
32881
+ // We never want to link here, only copy, because the launcher
32882
+ // file often has the same name for every entrypoint, which means that
32883
+ // every build for every entrypoint overwrites the launcher of the previous
32884
+ // one, so linking would end with a broken reference.
32881
32885
  await fs_extra_1.default.ensureDir(path_1.dirname(entry));
32882
- await linkOrCopy(handlerFileOrigin, entry);
32883
- const toRemove = [];
32884
- // You can find more details about this at the point where the
32885
- // `sourceFilesAfterBuild` is created originally.
32886
+ await fs_extra_1.default.copy(handlerFile.fsPath, entry);
32887
+ const newFilesEntrypoint = [];
32888
+ const newDirectoriesEntrypoint = [];
32889
+ const preBuildFiles = Object.values(sourceFilesPreBuild).map(file => {
32890
+ return file.fsPath;
32891
+ });
32892
+ // Generate a list of directories and files that weren't present
32893
+ // before the entrypoint was processed by the Legacy Runtime, so
32894
+ // that we can perform a cleanup later. We need to divide into files
32895
+ // and directories because only cleaning up files might leave empty
32896
+ // directories, and listing directories separately also speeds up the
32897
+ // build because we can just delete them, which wipes all of their nested
32898
+ // paths, instead of iterating through all files that should be deleted.
32886
32899
  for (const file in sourceFilesAfterBuild) {
32887
32900
  if (!sourceFilesPreBuild[file]) {
32888
32901
  const path = sourceFilesAfterBuild[file].fsPath;
32889
- toRemove.push(fs_extra_1.default.remove(path));
32902
+ const dirPath = path_1.dirname(path);
32903
+ // If none of the files that were present before the entrypoint
32904
+ // was processed are contained within the directory we're looking
32905
+ // at right now, then we know it's a newly added directory
32906
+ // and it can therefore be removed later on.
32907
+ const isNewDir = !preBuildFiles.some(filePath => {
32908
+ return path_1.dirname(filePath).startsWith(dirPath);
32909
+ });
32910
+ // Check out the list of tracked directories that were
32911
+ // newly added and see if one of them contains the path
32912
+ // we're looking at.
32913
+ const hasParentDir = newDirectoriesEntrypoint.some(dir => {
32914
+ return path.startsWith(dir);
32915
+ });
32916
+ // If we have already tracked a directory that was newly
32917
+ // added that sits above the file or directory that we're
32918
+ // looking at, we don't need to add more entries to the list
32919
+ // because when the parent will get removed in the future,
32920
+ // all of its children (and therefore the path we're looking at)
32921
+ // will automatically get removed anyways.
32922
+ if (hasParentDir) {
32923
+ continue;
32924
+ }
32925
+ if (isNewDir) {
32926
+ newDirectoriesEntrypoint.push(dirPath);
32927
+ }
32928
+ else {
32929
+ newFilesEntrypoint.push(path);
32930
+ }
32890
32931
  }
32891
32932
  }
32892
- await Promise.all(toRemove);
32893
32933
  const tracedFiles = [];
32894
- Object.entries(lambdaFiles).forEach(async ([relPath, file]) => {
32934
+ const linkers = Object.entries(lambdaFiles).map(async ([relPath, file]) => {
32895
32935
  const newPath = path_1.join(traceDir, relPath);
32896
32936
  // The handler was already moved into position above.
32897
- if (relPath === handlerFilePath) {
32937
+ if (relPath === handlerFileBase) {
32898
32938
  return;
32899
32939
  }
32900
32940
  tracedFiles.push({ absolutePath: newPath, relativePath: relPath });
32901
- if (file.fsPath) {
32902
- await linkOrCopy(file.fsPath, newPath);
32941
+ const { fsPath, type } = file;
32942
+ if (fsPath) {
32943
+ await fs_extra_1.default.ensureDir(path_1.dirname(newPath));
32944
+ const isNewFile = newFilesEntrypoint.includes(fsPath);
32945
+ const isInsideNewDirectory = newDirectoriesEntrypoint.some(dirPath => {
32946
+ return fsPath.startsWith(dirPath);
32947
+ });
32948
+ // With this, we're making sure that files in the `workPath` that existed
32949
+ // before the Legacy Runtime was invoked (source files) are linked from
32950
+ // `.output` instead of copying there (the latter only happens if linking fails),
32951
+ // which is the fastest solution. However, files that are created fresh
32952
+ // by the Legacy Runtimes are always copied, because their link destinations
32953
+ // are likely to be overwritten every time an entrypoint is processed by
32954
+ // the Legacy Runtime. This is likely to overwrite the destination on subsequent
32955
+ // runs, but that's also how `workPath` used to work originally, without
32956
+ // the File System API (meaning that there was one `workPath` for all entrypoints).
32957
+ if (isNewFile || isInsideNewDirectory) {
32958
+ _1.debug(`Copying from ${fsPath} to ${newPath}`);
32959
+ await fs_extra_1.default.copy(fsPath, newPath);
32960
+ }
32961
+ else {
32962
+ await linkOrCopy(fsPath, newPath);
32963
+ }
32903
32964
  }
32904
- else if (file.type === 'FileBlob') {
32965
+ else if (type === 'FileBlob') {
32905
32966
  const { data, mode } = file;
32906
32967
  await fs_extra_1.default.writeFile(newPath, data, { mode });
32907
32968
  }
32908
32969
  else {
32909
- throw new Error(`Unknown file type: ${file.type}`);
32970
+ throw new Error(`Unknown file type: ${type}`);
32910
32971
  }
32911
32972
  });
32912
- const nft = path_1.join(workPath, '.output', 'server', 'pages', `${entrypoint}.nft.json`);
32973
+ linkersRuntime = linkersRuntime.concat(linkers);
32974
+ const nft = `${entry}.nft.json`;
32913
32975
  const json = JSON.stringify({
32914
32976
  version: 1,
32915
32977
  files: tracedFiles.map(file => ({
32916
- input: normalize_path_1.normalizePath(path_1.relative(nft, file.absolutePath)),
32978
+ input: normalize_path_1.normalizePath(path_1.relative(path_1.dirname(nft), file.absolutePath)),
32917
32979
  output: normalize_path_1.normalizePath(file.relativePath),
32918
32980
  })),
32919
32981
  });
32920
32982
  await fs_extra_1.default.ensureDir(path_1.dirname(nft));
32921
32983
  await fs_extra_1.default.writeFile(nft, json);
32984
+ // Extend the list of directories and files that were created by the
32985
+ // Legacy Runtime with the list of directories and files that were
32986
+ // created for the entrypoint that was just processed above.
32987
+ newPathsRuntime = new Set([
32988
+ ...newPathsRuntime,
32989
+ ...newFilesEntrypoint,
32990
+ ...newDirectoriesEntrypoint,
32991
+ ]);
32992
+ // Add an entry that will later on be added to the `functions-manifest.json`
32993
+ // file that is placed inside of the `.output` directory.
32994
+ pages[normalize_path_1.normalizePath(entryPath)] = {
32995
+ // Because the underlying file used as a handler was placed
32996
+ // inside `.output/server/pages/api`, it no longer has the name it originally
32997
+ // had and is now named after the API Route that it's responsible for,
32998
+ // so we have to adjust the name of the Lambda handler accordingly.
32999
+ handler: handler.replace(handlerFileName, path_1.parse(entry).name),
33000
+ runtime: output.runtime,
33001
+ memory: output.memory,
33002
+ maxDuration: output.maxDuration,
33003
+ environment: output.environment,
33004
+ allowQuery: output.allowQuery,
33005
+ };
32922
33006
  }
33007
+ // Instead of of waiting for all of the linking to be done for every
33008
+ // entrypoint before processing the next one, we immediately handle all
33009
+ // of them one after the other, while then waiting for the linking
33010
+ // to finish right here, before we clean up newly created files below.
33011
+ await Promise.all(linkersRuntime);
33012
+ // A list of all the files that were created by the Legacy Runtime,
33013
+ // which we'd like to remove from the File System.
33014
+ const toRemove = Array.from(newPathsRuntime).map(path => {
33015
+ _1.debug(`Removing ${path} as part of cleanup`);
33016
+ return fs_extra_1.default.remove(path);
33017
+ });
33018
+ // Once all the entrypoints have been processed, we'd like to
33019
+ // remove all the files from `workPath` that originally weren't present
33020
+ // before the Legacy Runtime began running, because the `workPath`
33021
+ // is nowadays the directory in which the user keeps their source code, since
33022
+ // we're no longer running separate parallel builds for every Legacy Runtime.
33023
+ await Promise.all(toRemove);
33024
+ // Add any Serverless Functions that were exposed by the Legacy Runtime
33025
+ // to the `functions-manifest.json` file provided in `.output`.
32923
33026
  await updateFunctionsManifest({ workPath, pages });
32924
33027
  };
32925
33028
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "2.12.3-canary.31",
3
+ "version": "2.12.3-canary.35",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -49,5 +49,5 @@
49
49
  "typescript": "4.3.4",
50
50
  "yazl": "2.4.3"
51
51
  },
52
- "gitHead": "6f4a1b527ba01973490e1fb2e4c48ccb2841cd86"
52
+ "gitHead": "2c3ddffaacb370eb4c0893815b3bc7417f92d432"
53
53
  }