index.js
function getIncludes(file) {
    var content = String(file.contents);
    var matches = [];

    while (regexMatch = DIRECTIVE_REGEX.exec(content)) {
      matches.push(regexMatch);
    }

    // For every require fetch it's matching files
    var fileLists = _.map(matches, function(match) {
      return globMatch(match, file).sort();
    });

    // Merge all matching file lists into one concat list
    var order = _.reduce(fileLists, function(memo, fileList) {
      return _.union(memo, fileList);
    }, []);

    // And self to include list
    order.push(file.relative);
    return order;
  }
function getIncludes(file) {
    var content = String(file.contents);
    var matches = [];

    while (regexMatch = DIRECTIVE_REGEX.exec(content)) {
      matches.push(regexMatch);
    }

    // For every require fetch it's matching files
    var fileLists = _.map(matches, function(match) {
      return globMatch(match, file).sort();
    });

    // Merge all matching file lists into one concat list
    var order = _.reduce(fileLists, function(memo, fileList) {
      return _.union(memo, fileList);
    }, []);

    // And self to include list
    order.push(file.relative);
    return order;
  }
function getIncludes ( file ) { var content = String ( file . contents ) ; var matches = [ ] ; while ( regexMatch = DIRECTIVE_REGEX . exec ( content ) ) { matches . push ( regexMatch ) ; } // For every require fetch it's matching files var fileLists = _ . map ( matches , function ( match ) { return globMatch ( match , file ) . sort ( ) ; } ) ; // Merge all matching file lists into one concat list var order = _ . reduce ( fileLists , function ( memo , fileList ) { return _ . union ( memo , fileList ) ; } , [ ] ) ; // And self to include list order . push ( file . relative ) ; return order ; }
Get all includes for a file
Get all includes for a file