Search code examples
javascriptasynchronousloader

Do javascript loaders replace the need to do script combining?


Do script loaders replace the need to do script combining?

Or are they really complementary tools?


Solution

  • JavaScript loaders only defer JavaScript loading and provide lazy load or on-demand load experience for us. But they don't reduce HTTP requests. Thus, it totally depends. If you load 200KB of JavaScript as a combined file at first and only use 10KB, then you'd better separate JavaScript codes into their original files and use a loader to defer loading process to increase your performance.