After installing the cordova tools coming with Visual Studio 2015, I have created a new TypeScript-Cordova project and started playing around. I find the structure and the way the project is built wonderful. There is a very nice separation between the TypeScript part of the code and the "www" directory, which actually holds the compiled code. TypeScript is being compiled to a single file (appBundle.js) which is then served to the mobile device.

I have also noticed something nice - the guys @ Microsoft have included bower support! which means I can use bower to install (static) dependencies. It is so wonderfully integrated, that it includes auto-complete, including versions, and auto-update once you change bower.json.

BUT!! There is a little problem. After installing the bower components, they cannot be used in the cordova project, as only what's in the "www" directory is being included.
The first solution was to copy all of those dependencies to the www/scripts directory, which of course worked. Downside is - it is not automated - updating bower.json will require to copy the new dependencies.
The simplest solution I could find (would be great to know if you have a different one) is to create a new file called .bowerrc in the main project directory (where bower.json is) and paste the following:

  "directory": "www/scripts/vendor"

This way, bower will install the dependencies straight to the www directory, and they can be used in the project. After doing that make sure bower updates its dependencies. If it didn't, simply remove one and add it again. It will automatically update.

Using the npm support, I have also added tsd (, which I find to be much better than NuGet for declaration files. And now all is set!

Connect with me on Twitter or LinkedIn to continue the discussion.

I'm an IT consultant, full stack developer, husband, and father. On my spare time I am contributing to Babylon.js WebGL game engine and other open source projects.

Berlin, Germany