Search code examples
javascriptrequirejsworkflowconcatenationsystemjs

Is it necessary to concatenate scripts if I load scripts with requirejs


I always read on the web "Use concatenation & minification for a faster site".

But I'm wondering, Is it necessary to concatenate my scripts if I am using AMD library like requireJs or SystemJs to load the scripts asynchronously?


Solution

  • IMO, it is especially important for applications with AMD libraries. One of the key reasons for optimization is to reduce the number of HTTP requests made to the server. Also, the front-end will be faster without network latency in the picture. Using AMD makes writing client side code seem more organized and promotes SOC, both can result in having a ton of files needed for a single feature.