const watchConfig = require('../node_modules/@ionic/app-scripts/config/watch.config');
const _ = require('lodash');

console.log('Editing watch for ignoring spec and e2e files');

_.forEach(watchConfig.watchers, (watch) =>{
    if(watch.paths.indexOf('{{SRC}}/**/*.ts') > -1) {
        watch.options = {
            ignored: /(.*(?=\.spec|\.e2e).*?\.ts)/
        };
    }
});

// console.log(watchConfig.watchers[0]);

module.exports = watchConfig;

@@ -219,16 +219,17 @@
 ) =%3E
+ 
 %7B%0A    if
 (wat
@@ -224,16 +224,17 @@
 %7B%0A    if
+ 
 (watch.p
@@ -260,18 +260,30 @@
 %7D%7D/**/*.
+(
 ts
+%7Chtml%7Cscss)
 ') %3E -1)
@@ -310,73 +310,36 @@
 ions
- = %7B%0A            ignored: /(.*(?=%5C.spec%7C%5C.e2e).*?%5C.ts)/%0A        %7D
+.ignored.push('**/*.e2e.ts')
 ;%0A  

fix watch task to support the current app-scripts