plugin-loader.js 656 B

123456789101112131415161718192021222324
  1. /**
  2. * @todo Add tests for browser `@plugin`
  3. */
  4. import AbstractPluginLoader from '../less/environment/abstract-plugin-loader.js';
  5. /**
  6. * Browser Plugin Loader
  7. */
  8. const PluginLoader = function(less) {
  9. this.less = less;
  10. // Should we shim this.require for browser? Probably not?
  11. };
  12. PluginLoader.prototype = Object.assign(new AbstractPluginLoader(), {
  13. loadPlugin(filename, basePath, context, environment, fileManager) {
  14. return new Promise((fulfill, reject) => {
  15. fileManager.loadFile(filename, basePath, context, environment)
  16. .then(fulfill).catch(reject);
  17. });
  18. }
  19. });
  20. export default PluginLoader;