Skip to content

Commit ffcf11b

Browse files
committed
review
1 parent cf8ce94 commit ffcf11b

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

packages/open-next/src/build/copyTracedFiles.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ const EXCLUDED_PACKAGES = [
4545
"next/dist/compiled/amphtml-validator",
4646
];
4747

48-
function isExcluded(srcPath: string): string | undefined {
49-
return EXCLUDED_PACKAGES.find((excluded) =>
48+
function isExcluded(srcPath: string): boolean {
49+
return EXCLUDED_PACKAGES.some((excluded) =>
5050
srcPath.match(getCrossPlatformPathRegex(`/node_modules/${excluded}/`)),
5151
);
5252
}
@@ -254,17 +254,10 @@ File ${serverPath} does not exist
254254

255255
// Only files that are actually copied
256256
const tracedFiles: string[] = [];
257-
// Packages that are excluded and not copied
258-
const excludedPackages = new Set<string>();
259257
//Actually copy the files
260258
filesToCopy.forEach((to, from) => {
261259
// We don't want to copy excluded packages (e.g. sharp)
262-
const excluded = isExcluded(from);
263-
if (excluded) {
264-
if (excluded && !excludedPackages.has(excluded)) {
265-
logger.debug("Skipping excluded package:", excluded);
266-
excludedPackages.add(excluded);
267-
}
260+
if (isExcluded(from)) {
268261
return;
269262
}
270263
tracedFiles.push(to);

0 commit comments

Comments
 (0)