@netlify/edge-bundler 4.0.0 → 4.0.2
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/deno/lib/common.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { load } from "https://deno.land/x/eszip@v0.28.0/loader.ts";
|
|
|
2
2
|
import { LoadResponse } from "https://deno.land/x/eszip@v0.28.0/mod.ts";
|
|
3
3
|
import * as path from "https://deno.land/std@0.127.0/path/mod.ts";
|
|
4
4
|
import { retryAsync } from "https://deno.land/x/retry@v2.0.0/mod.ts";
|
|
5
|
+
import { isTooManyTries } from "https://deno.land/x/retry@v2.0.0/retry/tooManyTries.ts";
|
|
5
6
|
|
|
6
7
|
const inlineModule = (specifier: string, content: string): LoadResponse => {
|
|
7
8
|
return {
|
|
@@ -35,10 +36,17 @@ const loadWithRetry = (specifier: string, delay = 1000, maxTry = 3) => {
|
|
|
35
36
|
return load(specifier);
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
try {
|
|
40
|
+
return retryAsync(() => load(specifier), {
|
|
41
|
+
delay,
|
|
42
|
+
maxTry,
|
|
43
|
+
});
|
|
44
|
+
} catch (error) {
|
|
45
|
+
if (isTooManyTries(error)) {
|
|
46
|
+
console.error(`Loading ${specifier} failed after ${maxTry} tries.`);
|
|
47
|
+
}
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
42
50
|
};
|
|
43
51
|
|
|
44
52
|
export { inlineModule, loadFromVirtualRoot, loadWithRetry };
|
|
@@ -5,7 +5,7 @@ import { pathToFileURL } from 'url';
|
|
|
5
5
|
import { deleteAsync } from 'del';
|
|
6
6
|
import { wrapBundleError } from '../bundle_error.js';
|
|
7
7
|
import { getFileHash } from '../utils/sha256.js';
|
|
8
|
-
const BOOTSTRAP_LATEST = 'https://
|
|
8
|
+
const BOOTSTRAP_LATEST = 'https://63735623f23a7a000841dfb9--edge.netlify.com/bootstrap/index-combined.ts';
|
|
9
9
|
const bundleJS = async ({ buildID, debug, deno, distDirectory, functions, importMap, }) => {
|
|
10
10
|
const stage2Path = await generateStage2({ distDirectory, functions, fileName: `${buildID}-pre.js` });
|
|
11
11
|
const extension = '.js';
|