I started looking for a solution to this problem because moving to npm is one of the preparation steps when upgrading AngularJS to Angular apps, and at work we are starting to tackle this challenge.

Bower is not recommended anymore, but chances are that if you created an AngularJS app years ago you’ve relied on it. It was is the core of a very popular Yeoman generator after all.

Our app is based on the aforementioned generator, it uses gulp as the task runner / build tool, with wiredep doing all the magic of injecting the bower dependencies in the html, and main-bower-files + gulp-inject injecting our own javascript and less/css files in the html.

Searching on Google I found a few approaches to this problem:

Using Yarn + bower-away : https://bower.io/blog/2017/how-to-migrate-away-from-bower/

+ : https://bower.io/blog/2017/how-to-migrate-away-from-bower/ Using npm + webpack : https://medium.com/netscape/bye-bye-bower-or-how-to-migrate-from-bower-to-npm-and-webpack-4eb2e1121a50

The approaches above introduce new tools, which at the moment would disrupt too much our app’s setup, so I went for a solution that required only the really necessary changes.