@polyfill-io-aot/builder
Version:
This is the builder module for polyfill-io-aot.
27 lines • 1.12 kB
JavaScript
;
const Executor_1 = require("../Executor");
const BuildEvent_1 = require("../interfaces/BuildEvent");
const symbols_1 = require("../symbols");
const xSpawn_1 = require("../xSpawn");
/** @internal */
class CompilePolyfillsExecutor extends Executor_1.Executor {
execute() {
this.emit(BuildEvent_1.BuildEvent.COMPILE_POLYFILLS_BEGIN);
this._ora.start('Compiling polyfills');
xSpawn_1.xSpawn(this.conf.packageManager, ['run', 'build'], {
cwd: this.builder[symbols_1.POLYFILL_LIBRARY_PKG],
stdio: process.env.POLYFILL_IO_AOT_STDIO || 'pipe'
}).then(() => {
this._ora.succeed('Polyfills compiled!');
this.emit(BuildEvent_1.BuildEvent.COMPILE_POLYFILLS_OK);
}, (e) => {
this._ora.fail(`Error compiling polyfills: ${this.formatError(e)}`);
this.emit(BuildEvent_1.BuildEvent.COMPILE_POLYFILLS_ERR, e);
setImmediate(() => {
this.onError(e);
});
});
}
}
module.exports = CompilePolyfillsExecutor;
//# sourceMappingURL=CompilePolyfillsExecutor.js.map