UNPKG

page-with

Version:

A library for usage example-driven in-browser testing of your own libraries.

22 lines (21 loc) 692 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.asyncCompile = void 0; function asyncCompile(compiler) { return new Promise((resolve, reject) => { compiler.run((error, stats) => { if (error) { return reject(error); } if (typeof stats === 'undefined') { return reject(); } if (stats === null || stats === void 0 ? void 0 : stats.hasErrors()) { const statsJson = stats.toJson('errors'); return reject(statsJson.errors); } resolve(stats); }); }); } exports.asyncCompile = asyncCompile;