Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.gitRepo.getPath().then(gitDirPath => {
// Watch the git dir path. We're really just interested in the index file,
// but watching it directly is Tricky because it's written atomically
// which looks like a delete + create.
const watcher = PatchWatcher.watch(gitDirPath, () => this.didChange())
this.subscriptions.add(new Disposable(() => watcher.close()))
})
}
this.gitRepo.getPath().then(gitDirPath => {
// Watch the git dir path. We're really just interested in the index file,
// but watching it directly is Tricky because it's written atomically
// which looks like a delete + create.
const watcher = PatchWatcher.watch(gitDirPath, () => this.didChange())
this.subscriptions.add(new Disposable(() => watcher.close()))
})
}
setTimeout(function(){
var pathwatcher = require('pathwatcher');
pathwatcher.watch(module.filename, /*{persistent: true},*/ function () {
clearTimeout(timeout);
timeout = setTimeout(function () {
hotCompile(module, module.filename, true);
console.log('hot reloaded '+module.filename);
}, 100);
});
},100);
}
stylePaths.forEach((stylePath) => {
if (!stylePath.endsWith('.less')) {
return;
}
PathWatcher.watch(stylePath, () => {
const styleEl = document.head.querySelector(`[source-path="${stylePath}"]`);
styleEl.textContent = this.loadStylesheet(styleEl.sourcePath, true);
});
});
};