I'm working with Intellij, which by default transpiles typescript files into js files in the same dir as the typescript source (so transpiling foo.ts produces foo.js). However, I also have some javascript files that are source files (not generated from typescript) that I don't want to inadvertently delete.
Example:
someDir\foo.ts // original ts source file
someDir\foo.js // generated by intellij tsc compile, should be deleted
someDir\bar.js // original js sourcefile, should NOTbe deleted!
Question:
I'd like to delete all **/*.js files that have a matching **/*.ts file - in the example above, I'd like to delete foo.js (as it has corresponding foo.ts) but not delete bar.js. Is there some gulp.src pattern that specify can be used to specify 'all **/*.js files that have a matching **/*.ts file'? If so, I can just pipe the resulting src stream to del.
Thanks,
Brad
p.s. And I know I can do some advanced Intellij typescript configuration to move the location of the generated js files, but I'd rather work with them in their default location. Another workaround would be to explicitly exclude the 'source js' files in the source stream (with !), but I'd rather do it with a pattern as it is less brittle.