ready.js 421 B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = ready;
  6. // eslint-disable-next-line consistent-return
  7. function ready(context, callback, req) {
  8. if (context.state) {
  9. return callback(context.stats);
  10. }
  11. const name = req && req.url || callback.name;
  12. context.logger.info(`wait until bundle finished${name ? `: ${name}` : ""}`);
  13. context.callbacks.push(callback);
  14. }