Angular CLI: 1.6.8
Node: 8.9.4
OS: win32 x64
Angular: 5.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cdk: 5.2.4
@angular/cli: 1.6.8
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.8
@schematics/angular: 0.1.17
typescript: 2.6.1
webpack: 3.10.0
ng build --prod --build-optimizer=false --vendor-chunkand run previous command for instance 3 times, note the hashes:
> ng build --prod --build-optimizer=false --vendor-chunk
Node#moveTo was deprecated. Use Container#append.
Date: 2018-04-05T17:37:06.484Z
Hash: 6567769b926051187dab
Time: 57784ms
chunk {0} 0.016a9bf2be18abb170c1.chunk.js () 277 kB [rendered]
chunk {1} main.e0d0b3bda5f04942944e.bundle.js (main) 2.94 MB [initial] [rendered]
chunk {2} polyfills.71070f1467b9cb77b8e5.bundle.js (polyfills) 98 kB [initial] [rendered]
chunk {3} styles.cd345cc5c6bcd7bb27a3.bundle.css (styles) 57.9 kB [initial] [rendered]
chunk {4} vendor.d630d3fc882739714918.bundle.js (vendor) 13.8 kB [initial] [rendered]
chunk {5} inline.527949f9a57d47da562e.bundle.js (inline) 1.49 kB [entry] [rendered]
> ng build --prod --build-optimizer=false --vendor-chunk
Node#moveTo was deprecated. Use Container#append.
Date: 2018-04-05T17:39:00.912Z
Hash: 45003e7908aa536afe88
Time: 65516ms
chunk {0} 0.016a9bf2be18abb170c1.chunk.js () 277 kB [rendered]
chunk {1} main.9dc9feff3e3f630123f0.bundle.js (main) 2.94 MB [initial] [rendered]
chunk {2} polyfills.71070f1467b9cb77b8e5.bundle.js (polyfills) 98 kB [initial] [rendered]
chunk {3} styles.cd345cc5c6bcd7bb27a3.bundle.css (styles) 57.9 kB [initial] [rendered]
chunk {4} vendor.d630d3fc882739714918.bundle.js (vendor) 13.8 kB [initial] [rendered]
chunk {5} inline.052178568c89a21b8291.bundle.js (inline) 1.49 kB [entry] [rendered]
md5-f8b9f69dd177694881708832d0695458
> ng build --prod --build-optimizer=false --vendor-chunk
Node#moveTo was deprecated. Use Container#append.
Date: 2018-04-05T17:55:53.295Z
Hash: 3d6edf77a1bf5bb2e071
Time: 55952ms
chunk {0} 0.016a9bf2be18abb170c1.chunk.js () 277 kB [rendered]
chunk {1} main.b8a947f8ae3a97cc3727.bundle.js (main) 2.94 MB [initial] [rendered]
chunk {2} polyfills.71070f1467b9cb77b8e5.bundle.js (polyfills) 98 kB [initial] [rendered]
chunk {3} styles.cd345cc5c6bcd7bb27a3.bundle.css (styles) 57.9 kB [initial] [rendered]
chunk {4} vendor.d630d3fc882739714918.bundle.js (vendor) 13.8 kB [initial] [rendered]
chunk {5} inline.009d2384a8e227c15045.bundle.js (inline) 1.49 kB [entry] [rendered]
I didn't understand what's the correct behavior in case of angular-cli to generate new hashes for every file or not but anyway they are regenerated by some obscure principle.
as you can see there is a very dangerous behavior. somehow angular-cli generates the same hashes for chunks, styles, vendor and polyfills files even if they are changed.
as for me the process of generating hashes must be under a user control (!)
I've spent a lot of time to parse generated files, I meant index.html and inline.js in purpose for cache during deployment process.
at least in the end, a user should get different hashes.
@angular-cli guys, it's a meter of time to fix such an issue and I can make the fix on my own but I need to be sure in what direction I should start. sure it can be a workaround or a small quick fix but I'm really not sure that's enough
I really don't get what you are doing here. If you haven't done any major changes to the code, it is completely normal and expected that e.g. the vendor part (which is mostly Angular runtime you don't ever touch) does not change and therefore obviously doesn't change the hash.
If you think something is wrong, you would have to post some example source code of yours and show the changes you've made that you think should be enough to change the built chunks.
Also, is there any reason why you are disabling the build optimizer and enabling vendor chunks? It only makes the output unnecessarily big.
I really don't get what you are doing here. If you haven't done any major changes to the code, it is completely normal and expected that e.g. the vendor part (which is mostly Angular runtime you don't ever touch) does not change and therefore obviously doesn't change the hash.
I thought so too but seems that it's not or I missed something. of course, at first you as a developer think that you made a mistake
If you think something is wrong, you would have to post some example source code of yours and show the changes you've made that you think should be enough to change the built chunks.
unfortunately I'm not able to provide the whole code as you are and I'm sure it's not needed.
if you were a little more careful, you could notice that between 2nd and 3rd run I've left a comment. I can describe only that I've tried not just to change amount of code but I made some significant changes that were supposed to affect the generation of a new hash. I also played with vendors' libraries versions but haven't succeed that's why I've created that issue in the end.
Also, is there any reason why you are disabling the build optimizer and enabling vendor chunks? It only makes the output unnecessarily big.
in the demonstration purposes of course. I don't mindlessly shoved parameters in all holes trying to solve the problem. vendor chunk can be easily disabled.
We are about to go to production with cli based build and during testing we experienced an issue (something like e is undefined of some webpack variable when trying to load lazy module) that I think has something to do with compatibility between chunks.
For example let's say we have a main module and a lazy loaded admin module. We do many changes in the main module for the next release, but nothing gets changed inside admin module and hence the hash for it remains the same (it's content based?) and therefore it would be served from cache for any active user.
@D2KX Do you know if compatibility between main module and admin module is guaranteed and that any import in admin module would correctly reference exports in main module even if new things were added or some files removed?
@AndreiShostik if you make changes in the chunks but you alter code which is removed during minification, having the same hash is expected.
Let's close this issue for now. Feel free to reopen it with a example repo where we can reproduce it. Thanks for rising this!
I have changed in file so many time and so many things even unique number not generating. can you help me how I can add timestamp in file name.
I am facing lot a issues because of this. I think I have same issue as I am using lazy load functionality.
I faced the issue during soft update of files in deployment process when a user mustn't see any old cached files and moreover none empty page.
due to I'm using a CDN service it's not a big deal to check not a name but a date.
maybe it's not applicable for you @krishnpatel1 but anyway.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._