Skip to content

Commit 1b21ee4

Browse files
committed
fix: don't convert .mjs config path to url twice on Windows (#1113)
* fix: dont convert to file url again for mjs configs on windows * chore: changeset
1 parent 1c09b88 commit 1b21ee4

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

.changeset/four-walls-beg.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@callstack/repack": patch
3+
---
4+
5+
Fix failure to read `.mjs` config on Windows

packages/repack/src/commands/common/config/getConfigFilePath.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import fs from 'node:fs';
2-
import os from 'node:os';
32
import path from 'node:path';
4-
import url from 'node:url';
53
import {
64
DEFAULT_RSPACK_CONFIG_LOCATIONS,
75
DEFAULT_WEBPACK_CONFIG_LOCATIONS,
@@ -15,9 +13,6 @@ function discoverConfigFilePath(root: string, candidates: string[]) {
1513
: path.join(root, candidate);
1614

1715
if (fs.existsSync(filename)) {
18-
if (path.extname(filename) === '.mjs' && os.platform() === 'win32') {
19-
return url.pathToFileURL(filename).href;
20-
}
2116
return filename;
2217
}
2318
}

0 commit comments

Comments
 (0)