Skip to content

Commit

Permalink
fix(core): prettier 3 shouldn't cause errors due to esm + compile cache
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Sep 6, 2023
1 parent 2bc7031 commit 4c28925
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/nx/bin/nx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,15 @@ function main() {
process.env.NX_DAEMON = 'false';
require('nx/src/command-line/nx-commands').commandsObject.argv;
} else {
if (workspace && workspace.type === 'nx') {
if (
workspace &&
// Angular CLI uses ESM, which v8-compile-cache doesn't work with.
workspace.type === 'nx' &&
// These commands invoke Prettier, which uses ESM and fails with v8-compile-cache
!['format', 'format:check', 'format:write', 'g', 'generate'].some(
(cmd) => process.argv[3] === cmd
)
) {
require('v8-compile-cache');
}
// polyfill rxjs observable to avoid issues with multiple version of Observable installed in node_modules
Expand Down

0 comments on commit 4c28925

Please sign in to comment.