@vercel/build-utils 5.0.5 → 5.0.8
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/fs/download.js +14 -0
- package/dist/index.js +720 -711
- package/package.json +3 -3
package/dist/fs/download.js
CHANGED
@@ -67,6 +67,20 @@ async function download(files, basePath, meta) {
|
|
67
67
|
if (Array.isArray(filesChanged) && !filesChanged.includes(name)) {
|
68
68
|
return;
|
69
69
|
}
|
70
|
+
// Some builders resolve symlinks and return both
|
71
|
+
// a file, node_modules/<symlink>/package.json, and
|
72
|
+
// node_modules/<symlink>, a symlink.
|
73
|
+
// Removing the file matches how the yazl lambda zip
|
74
|
+
// behaves so we can use download() with `vercel build`.
|
75
|
+
const parts = name.split('/');
|
76
|
+
for (let i = 1; i < parts.length; i++) {
|
77
|
+
const dir = parts.slice(0, i).join('/');
|
78
|
+
const parent = files[dir];
|
79
|
+
if (parent && isSymbolicLink(parent.mode)) {
|
80
|
+
console.warn(`Warning: file "${name}" is within a symlinked directory "${dir}" and will be ignored`);
|
81
|
+
return;
|
82
|
+
}
|
83
|
+
}
|
70
84
|
const file = files[name];
|
71
85
|
const fsPath = path_1.default.join(basePath, name);
|
72
86
|
files2[name] = await downloadFile(file, fsPath);
|