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
{{ message }}
Repository navigation
CSS style file is generated with a random string in its name - AOT mode #3853
A lot of if not all backend solutions provide cache busting mechanism. For example in symfony the asset method: <script type="text/javascript" src="{{ asset("inline.bundle.js") }}"></script>.
I had to fork angular-cli and implement it myself, i did it in a non-destructive way (with cli flag). Will do a PR today i think.
@filipesilva what about a separate webpack config for the lazy styles? (scripts too?) It could run in parallel and since they're lazy they shouldn't have any overlap with the rest of the app.
And the webpack helper plugin contains inline.bundle.js. But I want to use some lazy loaded JS in <head></head> - @see: lazy.bundle.js - because of performance considerations.
This is very annoying, if we need just a plain JS on top of index.html.
@clydin that would work I suppose. I'm not too familiar with the multiple config setup and it's limitations (if any). Can you tell me how it would be better than having the single config? Is it faster to have separate configs for instance?
If there are such benefits then I don't see why it shouldn't be done even regardless of the chunk hashes.
One thing to keep in mind is that it would be preferable to not have the command fail when there is no entry for that config (like #3867 tries to do).
@fuitattila lazy generated files are not auto-injected, or at least they shouldn't be. I suppose it would be useful for some cases to choose where stuff is injected but since order matters that's not very easy to orchestrate.
Activity
jasonkrot commentedon Jan 4, 2017
ohh, i have the same issue...
fuitattila commentedon Jan 5, 2017
@filipesilva do you have any idea?
filipesilva commentedon Jan 5, 2017
There is no way to disable the hash for prod build currently. But I agree that it should be disabled by default for the lazy loaded scripts/styles.
aegyed91 commentedon Jan 5, 2017
A lot of if not all backend solutions provide cache busting mechanism. For example in symfony the
assetmethod:<script type="text/javascript" src="{{ asset("inline.bundle.js") }}"></script>.I had to fork angular-cli and implement it myself, i did it in a non-destructive way (with cli flag). Will do a PR today i think.
Here are the changes: 73ee829
@filipesilva
clydin commentedon Jan 6, 2017
@filipesilva what about a separate webpack config for the lazy styles? (scripts too?) It could run in parallel and since they're lazy they shouldn't have any overlap with the rest of the app.
fuitattila commentedon Jan 6, 2017
Another problem is for lazy generated JS files is that angular-cli injects newly generated JS files, to the end of
index.html, like that:And the webpack helper plugin contains
inline.bundle.js. But I want to use some lazy loaded JS in<head></head>- @see: lazy.bundle.js - because of performance considerations.This is very annoying, if we need just a plain JS on top of
index.html.filipesilva commentedon Jan 6, 2017
@clydin that would work I suppose. I'm not too familiar with the multiple config setup and it's limitations (if any). Can you tell me how it would be better than having the single config? Is it faster to have separate configs for instance?
If there are such benefits then I don't see why it shouldn't be done even regardless of the chunk hashes.
One thing to keep in mind is that it would be preferable to not have the command fail when there is no entry for that config (like #3867 tries to do).
@fuitattila lazy generated files are not auto-injected, or at least they shouldn't be. I suppose it would be useful for some cases to choose where stuff is injected but since order matters that's not very easy to orchestrate.
aegyed91 commentedon Jan 6, 2017
@filipesilva roger, will modify the PR after i get home from work
jerousseau commentedon Sep 11, 2017
I have the same issue, with the version 1.4 the script with output name and lazy does not include the hash but the style always include the hash.
riemerio commentedon Jan 18, 2018
For anyone who want to use global css scipts in .angular-cli.json lazy loaded without hash I wrote following script (e.g. patch-ng-cli.js)
Then run this script after npm install via npm scripts in package.json
AndreiShostik commentedon Apr 5, 2018
nice.
instead of the process simplification you need to struggle with angular-cli
clydin commentedon Aug 17, 2018
This has been corrected as of 6.1.0.
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.