eugeneware / debowerify

A browserify transform to enable the easy use of bower components in browserify client javascript projects. This can be used in conjunction with deamdify to require AMD components from bower as well.
493 stars 51 forks source link

Caching `bower.commands.list` result to `bowerModules` variable causes problems with constantly running build systems #46

Closed rikukissa closed 9 years ago

rikukissa commented 9 years ago

Caching bower.commands.list result to bowerModules variable causes problems with constantly running build systems (for example gulp, most likely with others too) since the variable is located outside the exported function scope.

At the moment it's necessary to restart the entire build system process every you install new bower module which is a bit annoying especially when this could be quite easily prevented. Also, it's possible to npm install and require stuff without getting errors about missing files.

All of this would be fixed just by placing the bowerModules variable inside the exported function. I don't think this would effect the performance in a noticeable way since fetching the bower modules would only happen once per build and the possible performance hit would only exist when multiple browserify builds are created in one process.