Webpack.js.org: AutomaticPrefetchPlugin not documented

Created on 14 Jun 2018  路  2Comments  路  Source: webpack/webpack.js.org

I cannot see the AutomaticPrefetchPlugin under plugins.
If it is very similar to the PrefetchPlugin we can add it there, create a separate menu entry and deep link it...

Most helpful comment

prefetch comes with two meanings in webpack:

  • (web) prefetch: adding a prefetch <link> tag.
  • (build) prefetch: discovering a module in the graph earlier to start building these module (and dependencies) earlier (in parallel).

This is about (build) prefetch. The PrefetchPlugin discovers a single module earlier. The AutomaticPrefetchPlugin discovers all modules from the previous compilation earlier when watching.

May or may not have a performance benefit. I guess it's not that important considering that the incremental build times are pretty fast anyway.

All 2 comments

@sokra by looking at plugin code it seems that it will do prefetch to all NormalModules after compilation was done, can you provide any additional context/info we might add to docs for that?

prefetch comes with two meanings in webpack:

  • (web) prefetch: adding a prefetch <link> tag.
  • (build) prefetch: discovering a module in the graph earlier to start building these module (and dependencies) earlier (in parallel).

This is about (build) prefetch. The PrefetchPlugin discovers a single module earlier. The AutomaticPrefetchPlugin discovers all modules from the previous compilation earlier when watching.

May or may not have a performance benefit. I guess it's not that important considering that the incremental build times are pretty fast anyway.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

webpack-bot picture webpack-bot  路  27Comments

TheLarkInn picture TheLarkInn  路  23Comments

skipjack picture skipjack  路  60Comments

dmitriid picture dmitriid  路  17Comments

jouni-kantola picture jouni-kantola  路  19Comments