index.js 844 B

12345678910111213141516171819
  1. (function(exports) {
  2. var plugin = function(less) {
  3. var FileManager = less.FileManager, TestFileManager = new FileManager();
  4. function TestFileManager() { }
  5. TestFileManager.loadFile = function (filename, currentDirectory, options, environment, callback) {
  6. if (filename.match(/.*\.test$/)) {
  7. return less.environment.fileManagers[0].loadFile('colors.test', currentDirectory, options, environment, callback);
  8. }
  9. return less.environment.fileManagers[0].loadFile(filename, currentDirectory, options, environment, callback);
  10. };
  11. return TestFileManager;
  12. };
  13. exports.install = function(less, pluginManager) {
  14. less.environment.addFileManager(new plugin(less));
  15. };
  16. })(typeof exports === 'undefined' ? this['AddFilePlugin'] = {} : exports);