kibana-123
Version:
Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic
29 lines (23 loc) • 653 B
JavaScript
import BaseOptimizer from './base_optimizer';
import fromRoot from '../utils/from_root';
import { fromNode } from 'bluebird';
import { writeFile } from 'fs';
module.exports = class FsOptimizer extends BaseOptimizer {
async init() {
await this.initCompiler();
}
async run() {
if (!this.compiler) await this.init();
let stats = await fromNode(cb => {
this.compiler.run((err, stats) => {
if (err || !stats) return cb(err);
if (stats.hasErrors() || stats.hasWarnings()) {
return cb(this.failedStatsToError(stats));
}
else {
cb(null, stats);
}
});
});
}
};