Files
klz-cables.com/.pnpm-store/v10/files/ca/c3fb5a2768ed29248a21e8da610314e1e341256a7d5d01abda48e09b14761acbd82f963f5955a76b804f30cef66f3ead86967824ae0b9a6623975b444f5346
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

22 lines
507 B
Plaintext

import fs from 'fs';
import path from 'path';
/**
* Wrapper around `fs.watch` that provides a workaround
* for https://github.com/nodejs/node/issues/5039.
*/
function watchFile(filepath, callback) {
const directory = path.dirname(filepath);
const filename = path.basename(filepath);
return fs.watch(directory, {
persistent: false,
recursive: false
}, (event, changedFilename) => {
if (changedFilename === filename) {
callback();
}
});
}
export { watchFile as default };