File tree Expand file tree Collapse file tree 5 files changed +2
-34
lines changed Expand file tree Collapse file tree 5 files changed +2
-34
lines changed Original file line number Diff line number Diff line change 88
99import type { CompilerOptions } from '@angular/compiler-cli' ;
1010import type { PartialMessage } from 'esbuild' ;
11- import { createRequire , getCompileCacheDir } from 'node:module' ;
11+ import { createRequire } from 'node:module' ;
1212import { MessageChannel } from 'node:worker_threads' ;
1313import Piscina from 'piscina' ;
1414import type { SourceFile } from 'typescript' ;
@@ -41,11 +41,6 @@ export class ParallelCompilation extends AngularCompilation {
4141 useAtomics : ! process . versions . webcontainer ,
4242 filename : localRequire . resolve ( './parallel-worker' ) ,
4343 recordTiming : false ,
44- env : {
45- ...process . env ,
46- // Enable compile code caching if enabled for the main process (only exists on Node.js v22.8+)
47- 'NODE_COMPILE_CACHE' : getCompileCacheDir ?.( ) ,
48- } ,
4944 } ) ;
5045 }
5146
Original file line number Diff line number Diff line change 88
99import { createHash } from 'node:crypto' ;
1010import { readFile } from 'node:fs/promises' ;
11- import { getCompileCacheDir } from 'node:module' ;
1211import Piscina from 'piscina' ;
1312import { Cache } from './cache' ;
1413
@@ -63,11 +62,6 @@ export class JavaScriptTransformer {
6362 // Shutdown idle threads after 1 second of inactivity
6463 idleTimeout : 1000 ,
6564 recordTiming : false ,
66- env : {
67- ...process . env ,
68- // Enable compile code caching if enabled for the main process (only exists on Node.js v22.8+)
69- 'NODE_COMPILE_CACHE' : getCompileCacheDir ?.( ) ,
70- } ,
7165 } ) ;
7266
7367 return this . #workerPool;
Original file line number Diff line number Diff line change 77 */
88
99import assert from 'node:assert' ;
10- import { getCompileCacheDir } from 'node:module' ;
1110import { fileURLToPath , pathToFileURL } from 'node:url' ;
1211import { MessageChannel } from 'node:worker_threads' ;
1312import { Piscina } from 'piscina' ;
@@ -103,11 +102,6 @@ export class SassWorkerImplementation {
103102 // Shutdown idle threads after 1 second of inactivity
104103 idleTimeout : 1000 ,
105104 recordTiming : false ,
106- env : {
107- ...process . env ,
108- // Enable compile code caching if enabled for the main process (only exists on Node.js v22.8+)
109- 'NODE_COMPILE_CACHE' : getCompileCacheDir ?.( ) ,
110- } ,
111105 } ) ;
112106
113107 return this . #workerPool;
Original file line number Diff line number Diff line change 1717declare module 'esbuild' {
1818 export * from 'esbuild-wasm' ;
1919}
20-
21- /**
22- * Augment the Node.js module builtin types to support the v22.8+ compile cache functions
23- */
24- declare module 'node:module' {
25- function getCompileCacheDir ( ) : string | undefined ;
26- }
Original file line number Diff line number Diff line change 1818 * range.
1919 */
2020
21- // Enable on-disk code caching if available (Node.js 22.8+)
22- try {
23- const { enableCompileCache } = require ( 'node:module' ) ;
24-
25- enableCompileCache ?. ( ) ;
26- } catch { }
27-
28- // Initialize the Angular CLI
29- void import ( '../lib/init.js' ) ;
21+ import ( '../lib/init.js' ) ;
You can’t perform that action at this time.
0 commit comments