Understanding Angular production chunks

Viewed 1764

I'm trying to understand how Angular builds prod chunks. My prod-build produces the following files:

  • main.hash.js
  • polyfills.hash.js
  • runtime.hash.js
  • scripts.hash.js
  • xxx-xxx-module-ngfactory.hash.js
  • yyy-yyy-module-ngfactory.hash.js
  • default~xxx-xxx-module-ngfactory~yyy-yyy-module-ngfactory.hash.js

I know what the first 4 are, but I'm confused about the rest.

  1. xxx and yyy are lazy modules in my app, why does angular produce another file for them (default~...js)? what is it for?
  2. Is it possible that to replace yyy-yyy-module-ngfactory.hash.js file with another version of the module from a difference build (with a different hash of course, hash987 for example)?

I tried to do it: I built the app (version 2) and replaced the yyy module file with an older one, and then replaced the referenced hash number in runtime.hash.js but it failed downloading the old chunk. Could you explain why and if its possible?

0 Answers
Related