Blame view

node_modules/less/lib/less-browser/plugin-loader.js 667 Bytes
ce4c83ff   wxy   初始提交
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  // TODO: Add tests for browser @plugin
  /* global window */
  
  var AbstractPluginLoader = require('../less/environment/abstract-plugin-loader.js');
  
  /**
   * Browser Plugin Loader
   */
  var PluginLoader = function(less) {
      this.less = less;
      // Should we shim this.require for browser? Probably not?
  };
  
  PluginLoader.prototype = new AbstractPluginLoader();
  
  PluginLoader.prototype.loadPlugin = function(filename, basePath, context, environment, fileManager) {
      return new Promise(function(fulfill, reject) {
          fileManager.loadFile(filename, basePath, context, environment)
              .then(fulfill).catch(reject);
      });
  };
  
  module.exports = PluginLoader;