Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bin/repomix.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#!/usr/bin/env node

// https://nodejs.org/api/module.html#module-compile-cache
const nodeModule = require('node:module');
if (nodeModule.enableCompileCache && !process.env.NODE_DISABLE_COMPILE_CACHE) {
try {
nodeModule.enableCompileCache();
} catch {
// Ignore errors
}
Comment on lines +8 to +10
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Silently ignoring errors in the catch block can make debugging difficult if enableCompileCache() fails for an unexpected reason (e.g., file system permissions). While this feature is a non-critical performance optimization, it would be beneficial to log the error when in verbose mode. This provides visibility for debugging why the cache isn't working, without adding noise for regular users.

  } catch (error) {
    if (process.argv.includes('--verbose')) {
      console.warn('Warning: Failed to enable Node.js compile cache:', error);
    }
  }

}

const nodeVersion = process.versions.node;
const [major] = nodeVersion.split('.').map(Number);

Expand Down
Loading