jtomaszewski / ionic-cordova-gulp-seed

Ionic & Cordova & Gulp combo-seed - perfect for starting with Ionic framework!
Other
96 stars 23 forks source link

use browserify for build #8

Open mobidev111 opened 9 years ago

mobidev111 commented 9 years ago

browserify makes bundling the multiple modules much easier.

build task example: https://github.com/vigetlabs/gulp-starter/blob/master/gulpfile.js/config.js https://github.com/vigetlabs/gulp-starter/blob/33e33e763060e7052ee7b3da430a8dfdca050a4e/gulp/tasks/browserify.js

jtomaszewski commented 9 years ago

What would be the advantage of such solution? Do we gain anything that we don't have in the current build process?

mobidev111 commented 9 years ago

browserify handles dependency management of your modules very well - I can add/remove a module simply by add/removing the corresponding require() - and during the build process this change is taken into account directly.

"This means that the bundle you generate is completely self-contained and has everything your application needs to work with a pretty negligible overhead." https://github.com/substack/browserify-handbook#how-browserify-works

From your build process files I see that all js files in the app directory (whether needed or not) are concatenated during the build process

-> using browserify helps you to only add the referenced modules & thus automatically the resulting build artifact matches these modules

jtomaszewski commented 9 years ago

Yeah, but in Ionic apps propably:

I would still like to know what is a direct advantage of this solution. What do we gain that we don't have right now? Any real-world usage example?