|
| 1 | +diff --git a/src/executors/tsc/tsc.impl.js b/src/executors/tsc/tsc.impl.js |
| 2 | +index ebaf0575224dda78fcedaf4be33f6bb9fe98c33d..b7e654761c1af75e534f322a9f1ad1414ad5fef8 100644 |
| 3 | +--- a/src/executors/tsc/tsc.impl.js |
| 4 | ++++ b/src/executors/tsc/tsc.impl.js |
| 5 | +@@ -17,7 +17,11 @@ function determineModuleFormatFromTsConfig(absolutePathToTsConfig) { |
| 6 | + if (tsConfig.options.module === ts.ModuleKind.ES2015 || |
| 7 | + tsConfig.options.module === ts.ModuleKind.ES2020 || |
| 8 | + tsConfig.options.module === ts.ModuleKind.ES2022 || |
| 9 | +- tsConfig.options.module === ts.ModuleKind.ESNext) { |
| 10 | ++ tsConfig.options.module === ts.ModuleKind.ESNext || |
| 11 | ++ |
| 12 | ++ // in order to make tsc executor resolve to ESM, we need to force it against node16/nodenext - in reality this is dangeours operation as node16/nodenext provides no guarantees if shipped code is commonjs or esm |
| 13 | ++ tsConfig.options.module === ts.ModuleKind.Node16 || |
| 14 | ++ tsConfig.options.module === ts.ModuleKind.NodeNext) { |
| 15 | + return 'esm'; |
| 16 | + } |
| 17 | + else { |
| 18 | +diff --git a/src/utils/buildable-libs-utils.js b/src/utils/buildable-libs-utils.js |
| 19 | +index 79a0eba5b4df41e7996f1afed183c4f2df9b3cf9..f95d9b4587ad57774a9e430136f7d11d9b7bba1c 100644 |
| 20 | +--- a/src/utils/buildable-libs-utils.js |
| 21 | ++++ b/src/utils/buildable-libs-utils.js |
| 22 | +@@ -246,7 +246,7 @@ function checkDependentProjectsHaveBeenBuilt(root, projectName, targetName, proj |
| 23 | + ${missing.map((x) => ` - ${x.node.name}`).join('\n')} |
| 24 | + |
| 25 | + You might be missing a "targetDefaults" configuration in your root nx.json (https://nx.dev/reference/project-configuration#target-defaults), |
| 26 | +- or "dependsOn" configured in ${projectName}'s project.json (https://nx.dev/reference/project-configuration#dependson) |
| 27 | ++ or "dependsOn" configured in ${projectName}'s project.json (https://nx.dev/reference/project-configuration#dependson) |
| 28 | + `); |
| 29 | + return false; |
| 30 | + } |
| 31 | +@@ -277,7 +277,13 @@ function updatePaths(dependencies, paths) { |
| 32 | + // If there are outputs |
| 33 | + if (dep.outputs && dep.outputs.length > 0) { |
| 34 | + // Directly map the dependency name to the output paths (dist/packages/..., etc.) |
| 35 | +- paths[dep.name] = dep.outputs; |
| 36 | ++ // paths[dep.name] = dep.outputs; |
| 37 | ++ |
| 38 | ++ // Force Nx to resolve to .mts |
| 39 | ++ // - if node16/nodeNext is enabled, TS won't follow standard algorithm (if path alias points to directory - nx case) to resolve package.json#types |
| 40 | ++ // - thus we need to explicitly point path alias to .d.mts |
| 41 | ++ paths[dep.name] = dep.outputs.map(out => out + '/src/index.d.mts'); |
| 42 | ++ |
| 43 | + // check for secondary entrypoints |
| 44 | + // For each registered path |
| 45 | + for (const path of pathsKeys) { |
0 commit comments