0

I really get big trouble with incremental build (for develop process, in production build, I minified and concatenated files to some files).

My project (angular) have hundreds js file and It's cost me up to 2 minutes to load web page. Root cause: too many requests to get files (> 1000 files).

I have an idea to deal with this problem:

  • Concatenate all third-party librarys to one file (same as gulp-angular way).

  • Concatenate (concatenate only, not minify) js files in the same folder to one js file. only build all file in folder when one file which lie in that folder changed (using gulp-cache and gulp-remember).

Do you have any suggestion for me? Try browserify or webpack?

Jack
  • 724
  • 1
  • 8
  • 15

1 Answers1

0

to add to your approach you can incorporate minification which reduces the concatenated file. this further improves performance.

dknight
  • 1
  • 4
  • minification is typically employed once the code production ready. it obfuscates the code and so debugging at development stage turns difficult. – dknight Jun 21 '15 at 15:33
  • If the work is actively done one or fewer js files, then exclude such files from file concatenation, instead load them directly from the html. use grunt watch or similar mechanism to track changes these files and move the changed files to the server (livereload). This might cut short the deployment cycle. I'm still exploring this approach. – dknight Jun 21 '15 at 15:41
  • I'm following this approach, but i'm using gulp – Jack Jun 22 '15 at 15:34