Skip to content

Commit

Permalink
fix: fix algorithm to detect if package is hybrid or not
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Aug 26, 2024
1 parent 74e9608 commit 0193c07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/monorepo/src/utils/packages/buildHybridPackages.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export async function buildHybridPackage(packageDir, pkg, context) {
!silent && logger("Build hybrid package", chalk.cyan(pkg.name));

if (pkg.exports) {
if (pkg.exports.import && pkg.exports.require) {
const esmDir = join(packageDir, dirname(pkg.exports.import));
const commonJsDir = join(packageDir, dirname(pkg.exports.require));
if ((pkg.exports.import && pkg.exports.require) || (pkg.exports["."]?.import && pkg.exports["."]?.require)) {
const esmDir = join(packageDir, dirname(pkg.exports["."]?.import || pkg.exports.import));
const commonJsDir = join(packageDir, dirname(pkg.exports["."]?.require || pkg.exports.require));

await Promise.all([
transformCjsFileToEsm(esmDir, context),
Expand Down

0 comments on commit 0193c07

Please sign in to comment.