Typescript – how to exclude typescript compiled files from git

gitgitignoretypescript

I have a visual studio solution with a few asp.net 5 project. Inside every project I have a wwwroot directory and inside this an app directory that contains the html views, .js and .map files that are typescript files compiled in this position.
With the standard configuration these files are included in the checkin. How can configure the .gitignore file so all the .js and .map files, inside every subdir of the wwwroot\app directory of every project in the solution are ignored?

Best Answer

wwwroot/app/**/*.js
wwwroot/app/**/*.map

The ** will match everything inside app, also multiple levels of subdirectories.