Skip to content

Commit 91fa9d9

Browse files
authored
fix: support Node 22/23.6.0 strip types feature (#40)
1 parent 59fb1b8 commit 91fa9d9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "unconfig",
33
"type": "module",
44
"version": "7.0.0",
5-
"packageManager": "pnpm@10.2.1",
5+
"packageManager": "pnpm@10.4.0",
66
"description": "A universal solution for loading configurations.",
77
"author": "Anthony Fu <[email protected]>",
88
"license": "MIT",

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { LoadConfigOptions, LoadConfigResult, LoadConfigSource } from './ty
22
import { promises as fs } from 'node:fs'
33
import { basename, dirname, join } from 'node:path'
44
import process from 'node:process'
5+
import { pathToFileURL } from 'node:url'
56
import { notNullish, toArray } from '@antfu/utils'
67
import defu from 'defu'
78
import { findUp } from './fs'
@@ -146,7 +147,7 @@ async function loadConfigFile<T>(
146147
}
147148
else if (parser === 'import') {
148149
if (process.features.typescript || process.versions.bun || process.versions.deno) {
149-
const defaultImport = await import(bundleFilepath)
150+
const defaultImport = await import(pathToFileURL(bundleFilepath).href)
150151
config = interopDefault(defaultImport)
151152
}
152153
else {

0 commit comments

Comments
 (0)