UNPKG

@nx/vite

Version:

The Nx Plugin for building and testing applications using Vite

40 lines (39 loc) 1.05 kB
"use strict"; Object.defineProperty(exports, "NxReporter", { enumerable: true, get: function() { return NxReporter; } }); let NxReporter = class NxReporter { async *[Symbol.asyncIterator]() { do { const hasErrors = await this.deferred.promise; yield { hasErrors }; this.setupDeferred(); }while (this.watch) } setupDeferred() { let resolve; this.deferred = { promise: new Promise((res)=>{ resolve = res; }), resolve }; } onFinished(files, errors) { const hasErrors = files.some((f)=>{ var _f_result; return ((_f_result = f.result) == null ? void 0 : _f_result.state) === 'fail'; }) || (errors == null ? void 0 : errors.length) > 0; this.deferred.resolve(hasErrors); } constructor(watch){ this.watch = watch; this.setupDeferred(); } }; //# sourceMappingURL=nx-reporter.js.map