typescript-assistant
Version:
Combines and integrates professional Typescript tools into your project
27 lines • 968 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createWatcher = void 0;
const chokidar = require("chokidar");
let 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", () => {
// 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);
}
});
},
};
};
exports.createWatcher = createWatcher;
//# sourceMappingURL=watcher.js.map