Skip to content

Commit

Permalink
Merge pull request #1 from LibanHassan/LibanHassan-patch-1
Browse files Browse the repository at this point in the history
Altered handleFileEvent to be able to accept extensions other than .ts and .html
  • Loading branch information
LibanHassan authored May 24, 2017
2 parents 896e63a + df4a71e commit aaf3247
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tasks/ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,23 +430,23 @@ const pluginFn = function (grunt: IGrunt) {

// local event to handle file event
function handleFileEvent(filepath: string, displaystr: string, addedOrChanged: boolean = false) {

const acceptedExtentions = ['.ts', '.tsx', '.js', '.jsx', '.html'];

acceptedExtentions.forEach(
(extension) => {

// If extension is accepted and was not just run
if (utils.endsWith(filepath.toLowerCase(), extension) && (new Date().getTime() - lastCompile) > 100){

// Log and run the debounced version.
grunt.log.writeln((displaystr + ' >>' + filepath).yellow);

filterFilesTransformAndCompile();

return;
}

// Uncomment for debugging which files were ignored
// else if ((new Date().getTime() - lastCompile) <= 100){
// grunt.log.writeln((' ///' + ' >>' + filepath).grey);
Expand Down

0 comments on commit aaf3247

Please sign in to comment.