typescript-assistant
Version:
Combines and integrates professional Typescript tools into your project
22 lines • 864 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const chokidar = require("chokidar");
exports.createWatcher = (dependencies) => {
let { bus } = dependencies;
return {
watchSourceFileChanged: () => {
let timeout;
let watch = chokidar.watch('./**/*.ts', { ignored: ['.d.ts', 'node_modules', 'build/**/*', 'dist/**/*'], ignoreInitial: true });
watch.on('all', (evt, path) => {
// batch events for a short amount of time to catch an IDE doing a save-all
if (timeout === undefined) {
timeout = setTimeout(() => {
timeout = undefined;
bus.signal('source-files-changed');
}, 200);
}
});
}
};
};
//# sourceMappingURL=watcher.js.map