diff --git a/packages/extensions-sdk/src/cli/commands/helpers/load-config.ts b/packages/extensions-sdk/src/cli/commands/helpers/load-config.ts index 6c3593faf8..82977815d7 100644 --- a/packages/extensions-sdk/src/cli/commands/helpers/load-config.ts +++ b/packages/extensions-sdk/src/cli/commands/helpers/load-config.ts @@ -1,12 +1,14 @@ import { pathToRelativeUrl } from '@directus/utils/node'; import fse from 'fs-extra'; import path from 'path'; +import { fileURLToPath } from 'url'; import type { Config } from '../../types.js'; const CONFIG_FILE_NAMES = ['extension.config.js', 'extension.config.mjs', 'extension.config.cjs']; // This is needed to work around Typescript always transpiling import() to require() for CommonJS targets. const _import = new Function('url', 'return import(url)'); +const __dirname = path.dirname(fileURLToPath(import.meta.url)); export default async function loadConfig(): Promise { for (const fileName of CONFIG_FILE_NAMES) {