diff --git a/scripts/check-entry-graphs.mjs b/scripts/check-entry-graphs.mjs index a26291094..b3b033a73 100644 --- a/scripts/check-entry-graphs.mjs +++ b/scripts/check-entry-graphs.mjs @@ -12,7 +12,7 @@ */ import { existsSync, readdirSync, readFileSync, statSync } from "node:fs"; -import { dirname, relative, resolve } from "node:path"; +import { dirname, relative, resolve, sep } from "node:path"; import { fileURLToPath } from "node:url"; const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), ".."); @@ -153,7 +153,7 @@ for (const [pkgDir, budgets] of Object.entries(BUDGETS)) { failures += 1; continue; } - const graph = [...walk(source)].map((file) => relative(ROOT, file)); + const graph = [...walk(source)].map((file) => relative(ROOT, file).split(sep).join("/")); if (graph.length > budget.maxFiles) { console.error( `${pkgDir} export "${name}" reaches ${graph.length} files, budget ${budget.maxFiles}\n` +