79552166

Date: 2025-04-03 06:42:24
Score: 0.5
Natty:
Report link

We ended up changing the approach: instead of telling ESBuild to ignore a file on watch mode, we do not write the file if its contents are the same, like so:


const newContent = (...)

if (fs.existsSync(path)) {
  const currentContent = fs.readFileSync(path, 'utf8');
  if (currentContent === newContent) {
    process.exit(0);
  }
}

fs.writeFileSync(path, newContent);

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: menrodriguez