Skip to content

Commit

Permalink
revert path.sep
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish committed Jul 4, 2024
1 parent 193900d commit 6e1d464
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"prepublishOnly": "tsc && rm out/utils/*.d.ts && rm out/tsconfig.tsbuildinfo",
"prettier-check": "prettier --check .",
"prettier-fix": "prettier --write .",
"test": "jest --verbose",
"test": "jest",
"test-verbose": "tsc --sourceMap && jest --verbose --coverage --globals \"{\\\"coverage\\\":true}\""
},
"prettier": "@vercel/style-guide/prettier",
Expand Down
3 changes: 2 additions & 1 deletion src/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,7 @@ export default async function analyze(
node.arguments[0].type === 'Literal'
) {
const pathOrSpecifier = node.arguments[0].value;
console.log('module.register', pathOrSpecifier);
// It's a relative URL
if (pathOrSpecifier.startsWith('.')) {
// Compute the parentURL if it's statically analyzable
Expand All @@ -926,7 +927,7 @@ export default async function analyze(
// Make it a proper relative path
const relativeSrcPath = srcPath.startsWith('.')
? srcPath
: '.' + path.sep + srcPath;
: './' + srcPath;

imports.add(relativeSrcPath);
}
Expand Down
1 change: 0 additions & 1 deletion test/unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ for (const { testName, isRoot } of unitTests) {
process.platform === 'win32' &&
(isRoot || skipOnWindows.includes(testName))
) {
console.log(`Skipping unit test on Windows: ${testSuffix}`);
continue;
}
if (process.platform === 'darwin' && skipOnMac.includes(testName)) {
Expand Down

0 comments on commit 6e1d464

Please sign in to comment.