Skip to content

Commit 671fb2a

Browse files
committed
fix(build): normalize Windows paths in export validation
Normalize path separators to forward slashes before checking if path starts with 'external/' to fix Windows build failures.
1 parent 3316430 commit 671fb2a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/validate-dist-exports.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { fileURLToPath } from 'node:url'
1111
import colors from 'yoctocolors-cjs'
1212

1313
import { isQuiet } from '#socketsecurity/lib/argv/flags'
14+
import { normalizePath } from '#socketsecurity/lib/paths'
1415
import { pluralize } from '#socketsecurity/lib/words'
1516

1617
const __dirname = path.dirname(fileURLToPath(import.meta.url))
@@ -43,7 +44,9 @@ function checkExport(filePath) {
4344
// Skip external packages - they are internal implementation details
4445
// used by public dist/* modules. We only validate public exports.
4546
const relativePath = path.relative(distDir, filePath)
46-
if (relativePath.startsWith('external/')) {
47+
// Normalize path for cross-platform compatibility (Windows uses backslashes)
48+
const normalizedPath = normalizePath(relativePath)
49+
if (normalizedPath.startsWith('external/')) {
4750
return { path: filePath, ok: true, skipped: true }
4851
}
4952

0 commit comments

Comments
 (0)