From 3682e5c7e513885af3f3ec3cb31c120d76ffb106 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 25 Oct 2024 00:23:13 -0700 Subject: [PATCH] fix(glob): fs.glob uses native path separator which broke module IDs We need to ensure that the module IDs use URL-style (aka POSIX-style) path separators, even on Windows. --- build-tools/common.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-tools/common.js b/build-tools/common.js index 9f057eed..dc217edf 100644 --- a/build-tools/common.js +++ b/build-tools/common.js @@ -64,7 +64,8 @@ module.exports = { return glob(['**/*.js'], { cwd: dir }) .map(fileName => ({ path: path.join(dir, fileName), - moduleId: fileName.slice(0, -3) + // This is used as an identifier with URL-style (POSIX-style) path separators + moduleId: fileName.replaceAll(path.sep, path.posix.sep).slice(0, -3) })) .map(file => ({ [file.moduleId]: file })) .reduce((result, fragment) => Object.assign(result, fragment), {});