diff --git a/packages/specs/scalar/src/constants.ts b/packages/specs/scalar/src/constants.ts index e10e6d782c4..4f430b86cee 100644 --- a/packages/specs/scalar/src/constants.ts +++ b/packages/specs/scalar/src/constants.ts @@ -1,3 +1,4 @@ +import {getValue} from "@tsed/core"; import {join} from "path"; -export const ROOT_DIR = join(import.meta.dirname, ".."); +export const ROOT_DIR = join(getValue(import.meta, "dirname", ""), ".."); diff --git a/packages/specs/swagger/src/constants.ts b/packages/specs/swagger/src/constants.ts index 5eb54554b23..7858e4873cd 100644 --- a/packages/specs/swagger/src/constants.ts +++ b/packages/specs/swagger/src/constants.ts @@ -1,5 +1,7 @@ -import {join} from "path"; +import {join} from "node:path"; + +import {getValue} from "@tsed/core"; import getAbsoluteFSPath from "swagger-ui-dist/absolute-path.js"; export const SWAGGER_UI_DIST = getAbsoluteFSPath(); -export const ROOT_DIR = join(import.meta.dirname, ".."); +export const ROOT_DIR = join(getValue(import.meta, "dirname", ""), "..");