diff --git a/src/helpers/package.ts b/src/helpers/package.ts index d796a19..8de4710 100644 --- a/src/helpers/package.ts +++ b/src/helpers/package.ts @@ -1,3 +1,5 @@ +import { readFileSync } from 'fs'; + import { type NextUIComponents, nextUIComponents } from 'src/constants/component'; import { Logger } from './logger'; @@ -10,7 +12,7 @@ export async function getPackageInfo(packagePath: string) { let pkg; try { - pkg = await import(packagePath); + pkg = JSON.parse(readFileSync(packagePath, 'utf-8')); } catch (error) { Logger.prefix('error', `Error reading package.json file: ${packagePath} \nError: ${error}`); } diff --git a/tsconfig.json b/tsconfig.json index bce0dda..fc1cd92 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,7 @@ "compilerOptions": { "module": "ESNext", "baseUrl": ".", + "rootDir": ".", "lib": ["ESNext"], "target": "ES2019", "moduleDetection": "auto", @@ -32,7 +33,8 @@ "verbatimModuleSyntax": true, "noImplicitAny": false, "paths": { - "@helpers/*": ["src/helpers/*"] + "@helpers/*": ["src/helpers/*"], + "src/*": ["src/*"] } }, "include": ["**/*.js", "**/*.cjs", "**/*.mjs", "**/*.ts", "**/*.tsx", "**/*.d.ts"],