-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a new javascript_packs_with_chunks_tag tag helper #1898
Conversation
f2f4bc4
to
250de51
Compare
Is there an approach to using |
Also, there's a need to be able to generate a list of all the paths to packs, not just tags, i.e. when building a service worker that caches files. |
I'd advise against building a service worker with webpack. You will end up with multiple workers registered under differently hashed names within the same domain. (plus your sw file needs to be in the |
@jakeNiemiec Not sure what you mean. Are you suggesting that if an app requires service workers then to not use webpack at all? That seems like a huge shortcoming |
https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register#Examples
If your service worker is in This is why service workers are generally not "built". Some SW libraries may copy the file to the correct place, it all depends on the implementation. |
This PR has removed some existing functionality, which was to allow availability of pathnames of packs instead of just tags. This breaks my application unless I use private API's. Opening a discussion to philosophy of service workers is a big diversion and seems out of scope. Regardless, we now have to choose between using a private API that may go away at any time, turning off code splitting, re-architecting our build process, designing out or reverting to an older version of webpack, etc etc and all of these options mean delays and cost. Is that really how things should go? |
This PR adds a new chunks helper that addresses issues outlined here: #1835
Fixes #1835
which outputs following html, with depedencies de-deduped
javascript_packs_with_chunks_tag
is introduced to handle new webpack split chunks API: https://webpack.js.org/plugins/split-chunks-plugin/javascript_pack_tag
, will keep working the same way as before, so no breaking changes there.Thanks @javan, could you please review?