Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Add links based on webpackPreload/webpackPrefetch magic comments #108

Open
gcoombe opened this issue Jan 20, 2020 · 1 comment · May be fixed by #109
Open

Add links based on webpackPreload/webpackPrefetch magic comments #108

gcoombe opened this issue Jan 20, 2020 · 1 comment · May be fixed by #109

Comments

@gcoombe
Copy link

gcoombe commented Jan 20, 2020

As of 4.6.0 webpack will generate links based on webpackPreload/webpackPrefetch magic comments. However where we are attempting to preload/prefetch chunks from an entrypoint loading will not start until the parent as finished (See webpack/webpack#8342 (comment))

It would be great if chunks preloaded from an entrypoint were added as link tags by this plugin. I was thinking of adding an additional includeOption like initialAndChildren.

We would need to use data exposed in stats.entrypoints[].childAssets. The use of the stats api can slow down builds but only calling getStats if the consumer opts in through includeOption: initialAndChildren seems reasonable to me.

Happy to put up a PR if this is acceptable.

@gcoombe gcoombe linked a pull request Jan 21, 2020 that will close this issue
2 tasks
@gcoombe
Copy link
Author

gcoombe commented Jan 21, 2020

Put together a quick PR #109, would be great to get some initial thoughts!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant