File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change 11import { promises as fs } from 'node:fs'
22import { basename , dirname , join } from 'node:path'
3+ import { interopDefault } from 'mlly'
34import jiti from 'jiti'
45import { notNullish , toArray } from '@antfu/utils'
56import defu from 'defu'
@@ -131,14 +132,19 @@ async function loadConfigFile<T>(filepath: string, source: LoadConfigSource<T>):
131132 config = await parser ( filepath )
132133 }
133134 else if ( parser === 'require' ) {
134- config = await jiti ( filepath , {
135- interopDefault : true ,
136- cache : false ,
137- v8cache : false ,
138- esmResolve : true ,
139- // FIXME: https://github.com/unjs/jiti/pull/141
140- requireCache : false ,
141- } ) ( bundleFilepath )
135+ if ( process . versions . bun ) {
136+ const defaultImport = await import ( filepath )
137+ config = interopDefault ( defaultImport )
138+ } else {
139+ config = await jiti ( filepath , {
140+ interopDefault : true ,
141+ cache : false ,
142+ v8cache : false ,
143+ esmResolve : true ,
144+ // FIXME: https://github.com/unjs/jiti/pull/141
145+ requireCache : false ,
146+ } ) ( bundleFilepath )
147+ }
142148 }
143149 else if ( parser === 'json' ) {
144150 config = JSON . parse ( await read ( ) )
You can’t perform that action at this time.
0 commit comments