Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ module.exports = function(grunt) {
extractDeclared: function(filepath) {
return [filepath];
},
onlyConcatRequiredFiles: true
onlyConcatRequiredFiles: true,
exportConcatenationOrder: undefined
}
}
},
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ grunt.initConfig({
this is a default function that extracts declared modules names from file content
extractDeclared: function (filepath, filecontent) {
return this.getMatches(/declare\(['"]([^'"]+)['"]/g, filecontent);
}
},
export the path of all concated files in their concatenation (newline seperated) to this file
exportConcatenationOrder: undefined
*/
},
files: {
Expand Down
5 changes: 5 additions & 0 deletions tasks/concat_in_order.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ module.exports = function (grunt) {
}).join(EOL));

grunt.log.writeln('File "' + fileSet.dest + '" created.');

if (options.exportConcatenationOrder) {
grunt.file.write(options.exportConcatenationOrder, ordered.map(item => item.file).join("\n"));
grunt.log.writeln('Concatenation order exported to "' + options.exportConcatenationOrder + '".');
}
});
});

Expand Down