plugin-loader.js 871 B

123456789101112131415161718192021222324
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var tslib_1 = require("tslib");
  4. /**
  5. * @todo Add tests for browser `@plugin`
  6. */
  7. var abstract_plugin_loader_js_1 = tslib_1.__importDefault(require("../less/environment/abstract-plugin-loader.js"));
  8. /**
  9. * Browser Plugin Loader
  10. */
  11. var PluginLoader = function (less) {
  12. this.less = less;
  13. // Should we shim this.require for browser? Probably not?
  14. };
  15. PluginLoader.prototype = Object.assign(new abstract_plugin_loader_js_1.default(), {
  16. loadPlugin: function (filename, basePath, context, environment, fileManager) {
  17. return new Promise(function (fulfill, reject) {
  18. fileManager.loadFile(filename, basePath, context, environment)
  19. .then(fulfill).catch(reject);
  20. });
  21. }
  22. });
  23. exports.default = PluginLoader;
  24. //# sourceMappingURL=plugin-loader.js.map