index.js 672 B

12345678910111213141516171819
  1. (function(exports) {
  2. var preProcessor = function() {};
  3. preProcessor.prototype = {
  4. process : function (src, extra) {
  5. var injected = '@color: red;\n';
  6. var ignored = extra.imports.contentsIgnoredChars;
  7. var fileInfo = extra.fileInfo;
  8. ignored[fileInfo.filename] = ignored[fileInfo.filename] || 0;
  9. ignored[fileInfo.filename] += injected.length;
  10. return injected + src;
  11. }
  12. };
  13. exports.install = function(less, pluginManager) {
  14. pluginManager.addPreProcessor( new preProcessor() );
  15. };
  16. })(typeof exports === 'undefined' ? this['preProcessorPlugin'] = {} : exports);