loader.js 546 B

12345678910111213141516
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const utils_1 = require("./utils");
  4. const loader = function (source) {
  5. this.cacheable();
  6. const callback = this.async();
  7. if (!(0, utils_1.isFunction)(callback)) {
  8. throw new Error(utils_1.errorMessage.syncCompilation);
  9. }
  10. if (typeof source !== 'string') {
  11. throw new Error(utils_1.errorMessage.impossible);
  12. }
  13. void (0, utils_1.loadResources)(this, source, callback);
  14. };
  15. exports.default = loader;
  16. //# sourceMappingURL=loader.js.map