You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know, and I would love to keep 'em. But I'm delivering my bundle to a back-end developer who doesn't use the generated index.html but rather only wants to replace the old bundle with a new one without needing to change the hash.
@deebloo You could probably write a gulp-script that does that but it seems to me that that would be having two steps in the process that could be reduced to zero steps, adding hash and removing has. Instead of just not adding hash.
Thanks for the tip but the question remains, even though apparently badly put, is it possible to change the bundle process to not adding hash rather than is there a way to remvove hash.
I like the simplicity of the bundle process with CLI, I need to do absolutely nothing. But here I am in a situation wanting to do something and it just seems to me that this little change should be an ever so simple task.
Does --prod only add the hash and use the environments.prod file? If not, then this isn't a good solution, because they would want the other advantages of using --prod such as the tree-shaking and uglifying.
Reacted by Leo Globerman, Duy Tran, Yago López, Joel Hernández and Matthew Radcliffe
We ended up adding these to our build script:
ng build -prod
mv dist/main..bundle.js dist/main.bundle.js
mv dist/main..bundle.js.gz dist/main.bundle.js.gz
mv dist/styles..bundle.js dist/styles.bundle.js
mv dist/styles..bundle.js.gz dist/styles.bundle.js.gz
Reacted by Christophe Vidal, Tim Hyson, Mohammed Helaiwa and Matthew Radcliffe
@filipesilva / @deebloo : removing --prod has for sure not the same effect... We all have a specific and valid reason why we want to make a prod bundling, but don't want the hash. That shall be definitely an option in the angular-cli. Or maybe you shall allow to provide a Webpack config which could overwrite some default option. I see other issues which are raised, simply because the current configuration possibilities are to strict. Which is a paradox, because Webpack is actually extremely flexible in itself.
Please reopen the issue and consider this feature request.
Activity
Trevald commentedon Aug 28, 2016
I know, and I would love to keep 'em. But I'm delivering my bundle to a back-end developer who doesn't use the generated index.html but rather only wants to replace the old bundle with a new one without needing to change the hash.
deebloo commentedon Aug 28, 2016
Could you just write a script to do that for you?
Trevald commentedon Aug 28, 2016
@deebloo You could probably write a gulp-script that does that but it seems to me that that would be having two steps in the process that could be reduced to zero steps, adding hash and removing has. Instead of just not adding hash.
Thanks for the tip but the question remains, even though apparently badly put, is it possible to change the bundle process to not adding hash rather than is there a way to remvove hash.
I like the simplicity of the bundle process with CLI, I need to do absolutely nothing. But here I am in a situation wanting to do something and it just seems to me that this little change should be an ever so simple task.
filipesilva commentedon Sep 20, 2016
If you use
ng buildwithout the--prodflag you shouldn't get any hashes.bryanjjohnson commentedon Sep 26, 2016
Does --prod only add the hash and use the environments.prod file? If not, then this isn't a good solution, because they would want the other advantages of using --prod such as the tree-shaking and uglifying.
toiladuy commentedon Oct 17, 2016
Any idea or option to remove hash? I have the same issue.
bryanjjohnson commentedon Oct 17, 2016
We ended up adding these to our build script:
ng build -prod
mv dist/main..bundle.js dist/main.bundle.js
mv dist/main..bundle.js.gz dist/main.bundle.js.gz
mv dist/styles..bundle.js dist/styles.bundle.js
mv dist/styles..bundle.js.gz dist/styles.bundle.js.gz
0cv commentedon Nov 8, 2016
Thanks, that's helpful @bryanjjohnson .
@filipesilva / @deebloo : removing
--prodhas for sure not the same effect... We all have a specific and valid reason why we want to make a prod bundling, but don't want the hash. That shall be definitely an option in the angular-cli. Or maybe you shall allow to provide a Webpack config which could overwrite some default option. I see other issues which are raised, simply because the current configuration possibilities are to strict. Which is a paradox, because Webpack is actually extremely flexible in itself.Please reopen the issue and consider this feature request.
filipesilva commentedon Nov 21, 2016
Hash removal option being tracked in #1833
phil-ioniq commentedon Jan 3, 2017
Any update on if this will be implemented? I would also need to prevent the hash generation in the name for similar reasons
FerGabPereira commentedon Jan 9, 2017
any updates?
filipesilva commentedon Jan 9, 2017
Sorry I linked the wrong issue, here is where it's being tracked: #2774
dmesa commentedon Feb 12, 2017
Closed on #3885
try using:
ng build --prod --output-hashing none
SSAT commentedon Mar 2, 2018
ng build --prod --output-hasing media/none/bundles
output-hashing
--output-hashing (aliases: -oh)
Define the output filename cache-busting hashing mode.
Values: none, all, media, bundles
https://github.com/angular/angular-cli/wiki/build
WebStew commentedon Jun 7, 2018
Is it possible to add the hashing value as a url parameter? eg :
<script src="main.bundle.js?v=8ce0183eeaa599bafb462"></script>That way the cache busting stays intact and we have the benefit of static named files?
angular-automatic-lock-bot commentedon Sep 8, 2019
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.