chore: upgrade moduleResolution to Node16 (#9269)

This commit is contained in:
Harminder Virk
2024-09-24 17:19:20 +05:30
committed by GitHub
parent d721282600
commit 9e711720dd
216 changed files with 981 additions and 2439 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ import path from "path"
import { existsSync } from "fs"
import { logger } from "@medusajs/framework"
import { ExecArgs } from "@medusajs/types"
import { dynamicImport } from "@medusajs/utils"
type Options = {
file: string
@@ -22,7 +23,7 @@ export default async function exec({ file, args }: Options) {
throw new Error(`File ${filePath} doesn't exist.`)
}
const scriptToExec = (await import(path.resolve(filePath))).default
const scriptToExec = (await dynamicImport(path.resolve(filePath))).default
if (!scriptToExec || typeof scriptToExec !== "function") {
throw new Error(`File doesn't default export a function to execute.`)