Skip to content

Commit 1d07215

Browse files
authored
Fix config file path resolution on windows (#359)
1 parent 20ba5da commit 1d07215

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/size-limit/get-config.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { globby } from 'globby'
33
import { lilconfig } from 'lilconfig'
44
import { createRequire } from 'node:module'
55
import { dirname, isAbsolute, join, relative } from 'node:path'
6-
import { fileURLToPath } from 'node:url'
6+
import { fileURLToPath, pathToFileURL } from 'node:url'
77

88
import { SizeLimitError } from './size-limit-error.js'
99

@@ -83,7 +83,8 @@ function toName(files, cwd) {
8383
return files.map(i => (i.startsWith(cwd) ? relative(cwd, i) : i)).join(', ')
8484
}
8585

86-
const dynamicImport = async filePath => (await import(filePath)).default
86+
const dynamicImport = async filePath =>
87+
(await import(pathToFileURL(filePath).href)).default
8788

8889
const tsLoader = async filePath => {
8990
let jiti = (await import('jiti')).default(fileURLToPath(import.meta.url), {

0 commit comments

Comments
 (0)