@pylonsync/functions 0.4.14 → 0.4.15
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 +1 -1
- package/src/ssr-client-bundler.ts +12 -8
package/package.json
CHANGED
|
@@ -1621,11 +1621,17 @@ async function _doBuildInner(
|
|
|
1621
1621
|
// against; the build itself is fine.
|
|
1622
1622
|
}
|
|
1623
1623
|
|
|
1624
|
-
// Scan a built JS file for
|
|
1625
|
-
//
|
|
1626
|
-
//
|
|
1627
|
-
//
|
|
1628
|
-
//
|
|
1624
|
+
// Scan a built JS file for STATIC `import` literals pointing at
|
|
1625
|
+
// `./chunks/<file>.js` and return them resolved to outdir-relative paths.
|
|
1626
|
+
// Bun's minified output uses simple double quotes for module specifiers,
|
|
1627
|
+
// so a `matchAll` covers both `import X from "Y"` and bare `import "Y"`.
|
|
1628
|
+
//
|
|
1629
|
+
// DYNAMIC `import("Y")` is deliberately NOT matched. This list becomes the
|
|
1630
|
+
// route's modulepreload set, and a chunk the author deferred behind
|
|
1631
|
+
// `import()` must not be downloaded eagerly anyway — that would split the
|
|
1632
|
+
// code out of the entry (so it isn't parsed on load) while still shipping
|
|
1633
|
+
// every byte, which is the expensive half of the cost with none of the
|
|
1634
|
+
// saving. The trailing `(` is what distinguishes the two forms.
|
|
1629
1635
|
function scanChunkImports(jsAbsPath: string): string[] {
|
|
1630
1636
|
let src: string;
|
|
1631
1637
|
try {
|
|
@@ -1634,9 +1640,7 @@ async function _doBuildInner(
|
|
|
1634
1640
|
return [];
|
|
1635
1641
|
}
|
|
1636
1642
|
const found = new Set<string>();
|
|
1637
|
-
const matches = src.matchAll(
|
|
1638
|
-
/(?:from\s*|import\s*\(?\s*)["']([^"']+)["']/g,
|
|
1639
|
-
);
|
|
1643
|
+
const matches = src.matchAll(/(?:from\s*|import\s*)["']([^"']+)["']/g);
|
|
1640
1644
|
for (const m of matches) {
|
|
1641
1645
|
const spec = m[1];
|
|
1642
1646
|
if (spec.startsWith("./chunks/") || spec.startsWith("chunks/")) {
|