forked from rstackjs/rstack-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrs.js
More file actions
executable file
·25 lines (22 loc) · 721 Bytes
/
Copy pathrs.js
File metadata and controls
executable file
·25 lines (22 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env node
import nodeModule from 'node:module';
// enable on-disk code caching and share its directory with child workers
// requires Nodejs >= 22.8.0
const { enableCompileCache, constants } = nodeModule;
if (enableCompileCache) {
try {
const { directory, status } = enableCompileCache();
// ALREADY_ENABLED returns the active version-specific cache directory.
// Passing it to workers would append another version directory.
if (directory && status === constants.compileCacheStatus.ENABLED) {
process.env.NODE_COMPILE_CACHE = directory;
}
} catch {
// ignore errors
}
}
async function main() {
const { runCLI } = await import('../dist/index.js');
runCLI();
}
main();