sendMessage.js 402 B

1234567891011121314
  1. 'use strict';
  2. /* global __resourceQuery WorkerGlobalScope self */
  3. // Send messages to the outside, so plugins can consume it.
  4. function sendMsg(type, data) {
  5. if (typeof self !== 'undefined' && (typeof WorkerGlobalScope === 'undefined' || !(self instanceof WorkerGlobalScope))) {
  6. self.postMessage({
  7. type: "webpack".concat(type),
  8. data: data
  9. }, '*');
  10. }
  11. }
  12. module.exports = sendMsg;