Skip to content

Commit

Permalink
improve import
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Dec 28, 2024
1 parent 238cbb3 commit e3fddc2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions code/core/src/common/presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ const map =

async function getContent(input: PresetConfig) {
if (input.type === 'virtual') {
const { _type, _name, ...rest } = input;
const { type, name, ...rest } = input;
return rest;
}
const src = input.name ? input.name : input;
const jiti = createJiti(import.meta.url);
return await jiti.import(src, { default: true })
const jiti = createJiti(import.meta.url || pathToFileURL(__filename).href);
return await jiti.import(src);
}

export async function loadPreset(
Expand Down

0 comments on commit e3fddc2

Please sign in to comment.