From edd019e905fd918ee4dcb4f72f0cdd7f791f6300 Mon Sep 17 00:00:00 2001 From: David Festal Date: Mon, 8 Apr 2024 21:41:53 +0200 Subject: [PATCH] fix(cli): fix the `embed-as-dependencies` option on the `export-dynamic-plugin` CLI... (#1478) ... when run on a wrapper plugin that doesn't use a monorepo structure. Signed-off-by: David Festal --- .../export-dynamic-plugin/backend-embed-as-dependencies.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/commands/export-dynamic-plugin/backend-embed-as-dependencies.ts b/packages/cli/src/commands/export-dynamic-plugin/backend-embed-as-dependencies.ts index c7a8bcda6d..b93882dc03 100644 --- a/packages/cli/src/commands/export-dynamic-plugin/backend-embed-as-dependencies.ts +++ b/packages/cli/src/commands/export-dynamic-plugin/backend-embed-as-dependencies.ts @@ -61,7 +61,7 @@ export async function backend(opts: OptionValues): Promise { pkg, packagesToEmbed, monoRepoPackages, - createRequire(paths.targetDir), + createRequire(`${paths.targetDir}/package.json`), [], ); const embeddedPackages = embeddedResolvedPackages.map(e => e.packageName); @@ -731,7 +731,7 @@ function isPackageShared( } function validatePluginEntryPoints(target: string): string { - const dynamicPluginRequire = createRequire(target); + const dynamicPluginRequire = createRequire(`${target}/package.json`); // require plugin main module