Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(pluginPath => {
const match = pluginPath.match(/^file:(.+)$/);
if (match) {
pluginPath = match[1];
const watcher = new watchr.Watcher(pluginPath);
watcher.setConfig({
catchupDelay: 100,
});
const change = (/*changeType, fullPath, currentStat, previousStat*/) => {
this.broadcast('unload', plugin);
this.removePlugin(plugin)
.then(() => {
this.broadcast('load', plugin);
return this.requestPlugin(plugin, {
hotload: true,
});
})
.catch(err => {
console.warn(err);