css.on('add', (filePath) => { css.add(filePath) build.buildCSS() })
build.getSource((err, source) => { if (err) { throw err } locales.on('change', (filePath) => { const locale = getLocale(filePath) if (!selectedLocales || selectedLocales.includes(locale)) { console.log(`The language ${locale} is changed, '${filePath}' is modified.`) dynamicallyBuildOnLanguages(source, locale) } }) locales.on('add', (filePath) => { const locale = getLocale(filePath) if (!selectedLocales || selectedLocales.includes(locale)) { console.log(`The language ${locale} is changed, '${filePath}' is added.`) dynamicallyBuildOnLanguages(source, locale) locales.add(filePath) } }) })
startWatcher(embedderPath, exludePattern, client, mainFileName) { this._embedderPath = fileURLToPath(embedderPath); this._client = client; this._watcher = chokidar.watch([this._embedderPath], { ignored: new RegExp(exludePattern), awaitWriteFinish: true, ignorePermissionErrors: true }); const events = []; this._watcher.on('all', (event, name) => { if (event === 'add' || event === 'change' || event === 'unlink') { if (!events.length) setTimeout(() => client.filesChanged(events.splice(0)), 100); events.push({ type: event, name: pathToFileURL(name).toString() }); } }); this._watcher.on('error', console.error); }
css.on('change', () => build.buildCSS())
ignored: "**/node_modules/**" }) .on("ready", () => { debug("[WATCHING]".yellow, this.sourcePath); this.isWatching = true; this.emit("ready"); }) .on("add", this._onAdd.bind(this)) .on("addDir", this._onAdd.bind(this)) .on("change", this._onAdd.bind(this)) .on("unlink", this._onRemove.bind(this)) .on("unlinkDir", this._onRemove.bind(this)) .on("error", e => debug("[ERROR]".red, e)); } else { this.emit("ready");
layouts.on('change', () => build.fullBuild({ selectedLocales, preserveLocale }))
staticFiles.on('add', (filePath) => { staticFiles.add(filePath) build.copyStatic() })
layouts.on('add', (filePath) => { layouts.add(filePath) build.fullBuild({ selectedLocales, preserveLocale }) })
chokidar.watch( process.argv[2], options, ).on('all', (type, file) => { Log.debug('worker found file', file); process.send(file); });
chokidar.watch(templatePath).on('change', () => { template = fs.readFileSync(templatePath, 'utf-8'); console.log('index.html template updated.'); update(); });
// Regenerate component metadata when components or examples change. chokidar .watch([paths.examples, paths.components]) .on("change", function(event, path) { generate(paths); });
chokidar.watch(fileName).on("change", () => { console.log("Reloading web service data..."); createServer(); console.log("Reloading web service data complete."); });
chokidar.watch("./app").on("change", (event, path) => { console.log(event, path); reload(2); });
ignored: "**/node_modules/**" }) .on("ready", () => { debug("[WATCHING]".yellow, this.sourcePath); this.isWatching = true; this.emit("ready"); }) .on("add", this._onAdd.bind(this)) .on("addDir", this._onAdd.bind(this)) .on("change", this._onAdd.bind(this)) .on("unlink", this._onRemove.bind(this)) .on("unlinkDir", this._onRemove.bind(this)) .on("error", e => debug("[ERROR]".red, e)); } else { this.emit("ready");