@netlify/edge-bundler 14.9.14 → 14.9.16
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/dist/node/formats/tarball.js +14 -28
- package/package.json +3 -3
|
@@ -20,7 +20,6 @@ export const bundle = async ({ buildID, deno, distDirectory, functions, importMa
|
|
|
20
20
|
const entryPoints = functions.map((func) => func.path);
|
|
21
21
|
// Use deno info to get the module graph and identify which local files are actually needed.
|
|
22
22
|
// This avoids copying unnecessary files (like node_modules) that happen to be under commonPath.
|
|
23
|
-
// If module graph analysis fails, fall back to copying files from entry point directories.
|
|
24
23
|
const sourceFilesSet = await getRequiredSourceFiles(deno, entryPoints, importMap);
|
|
25
24
|
// Build prefix mappings to transform file:// URLs to relative paths
|
|
26
25
|
const npmVendorDir = '.netlify-npm-vendor';
|
|
@@ -127,39 +126,26 @@ const REWRITABLE_EXTENSIONS = new Set(['.ts', '.tsx', '.js', '.jsx', '.mjs', '.m
|
|
|
127
126
|
* Uses deno info to get the module graph and extract only the local source files
|
|
128
127
|
* that are actually needed by the entry points. This avoids copying unnecessary
|
|
129
128
|
* files (like node_modules, .next, etc.) that may be under the common path.
|
|
130
|
-
*
|
|
131
|
-
* If deno info fails, falls back to copying files from the directories containing
|
|
132
|
-
* the entry points (not the entire common path).
|
|
133
129
|
*/
|
|
134
130
|
async function getRequiredSourceFiles(deno, entryPoints, importMap) {
|
|
135
131
|
const localFiles = new Set();
|
|
136
132
|
const importMapDataUrl = importMap.withNodeBuiltins().toDataURL();
|
|
137
133
|
// Run deno info for each entry point and combine the results
|
|
138
134
|
for (const entryPoint of entryPoints) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
catch {
|
|
157
|
-
// If deno info fails for this entry point, fall back to copying files
|
|
158
|
-
// from its directory
|
|
159
|
-
const dir = path.dirname(entryPoint);
|
|
160
|
-
const files = await listRecursively(dir);
|
|
161
|
-
for (const file of files) {
|
|
162
|
-
localFiles.add(file);
|
|
135
|
+
const { stdout } = await deno.run([
|
|
136
|
+
'info',
|
|
137
|
+
'--json',
|
|
138
|
+
'--no-config',
|
|
139
|
+
'--import-map',
|
|
140
|
+
importMapDataUrl,
|
|
141
|
+
pathToFileURL(entryPoint).href,
|
|
142
|
+
]);
|
|
143
|
+
const graph = JSON.parse(stdout);
|
|
144
|
+
// Extract all local files from the module graph
|
|
145
|
+
for (const module of graph.modules) {
|
|
146
|
+
if (module.specifier.startsWith('file://')) {
|
|
147
|
+
const filePath = fileURLToPath(module.specifier);
|
|
148
|
+
localFiles.add(filePath);
|
|
163
149
|
}
|
|
164
150
|
}
|
|
165
151
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/edge-bundler",
|
|
3
|
-
"version": "14.9.
|
|
3
|
+
"version": "14.9.16",
|
|
4
4
|
"description": "Intelligently prepare Netlify Edge Functions for deployment",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/node/index.js",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"better-ajv-errors": "^1.2.0",
|
|
67
67
|
"common-path-prefix": "^3.0.0",
|
|
68
68
|
"env-paths": "^3.0.0",
|
|
69
|
-
"esbuild": "0.27.
|
|
69
|
+
"esbuild": "0.27.3",
|
|
70
70
|
"execa": "^8.0.0",
|
|
71
71
|
"find-up": "^7.0.0",
|
|
72
72
|
"get-port": "^7.0.0",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"urlpattern-polyfill": "8.0.2",
|
|
82
82
|
"uuid": "^11.0.0"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "6588f01d80a48a02ecdf660eead20ae0d728e075"
|
|
85
85
|
}
|