Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
em.on(evt, function(file) {
file = path.normalize(file);
// file = path.relative(cwd,file).replace(/\\/g,"/") || file;
file = path.relative(RES_ROOT,file).replace(/\\/g,"/") || file || "error/path";
console.log(getCurT() + " Send-Changed: " + color(file,"cyan"));
// send msg of changed file info
// sendMsg(file || "index.html");
tinyLr.changed(file || "index.html");//It is not 'server.changed({ params: { files: files }})'
});
});
monitor.on('created', (f, stat) => {
if (f.indexOf(`.${config.files.templates.extension}`) < 0) {
cmsTemplates.assets.copy()
tinylr.changed(f)
console.log(
'Assets have been synchronized after this creation: ' + f
)
} else {
this.getKeysFromSelect()
this.updateStructureAndTemplates()
if (typeof this.lserver != 'undefined') {
tinylr.changed(f)
}
this.events.template.emit('update')
}
})
monitor.on('changed', (f, curr, prev) => {
watcher.on('change', function (filepath) {
console.log('[Livereload] %s changed. Updating page.', filepath);
tinylr.changed(filepath);
});
});
monitor.on('created', f => {
this.updateReferences(f)
if (typeof this.lserver != 'undefined') {
tinylr.changed(f)
}
this.events.reference.emit('update')
})
monitor.on('changed', f => {
bundlerEmitter.on('update', () => {
LiveReload.changed(bundleUrl)
})
app.use(injectLiveReloadScript())
.on('all', function(event, file) {
livereloadServer.changed(file);
});
.on("unlink", filepath => {
logger(`File ${filepath} has been deleted`);
tinylr.changed(filepath);
});
}
watcher.on('all', function(event, path) {
tinylr.changed(path)
});
});
sendMsgTimer = setTimeout(function(){
tinyLr.changed(msg);//It is not 'server.changed({ params: { files: files }})'
}, 0);
}