Skip to content

Commit

Permalink
Fix config file path resolution on windows (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 committed Mar 16, 2024
1 parent 20ba5da commit 1d07215
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/size-limit/get-config.js
Expand Up @@ -3,7 +3,7 @@ import { globby } from 'globby'
import { lilconfig } from 'lilconfig'
import { createRequire } from 'node:module'
import { dirname, isAbsolute, join, relative } from 'node:path'
import { fileURLToPath } from 'node:url'
import { fileURLToPath, pathToFileURL } from 'node:url'

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

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

const dynamicImport = async filePath => (await import(filePath)).default
const dynamicImport = async filePath =>
(await import(pathToFileURL(filePath).href)).default

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

0 comments on commit 1d07215

Please sign in to comment.