The AutomaticPrefetchPlugin
discovers all modules from the previous compilation upfront while watching for changes, trying to improve the incremental build times. Compared to PrefetchPlugin
which discovers a single module upfront.
webpack.config.js
module.exports = {
// ...
plugins: [new webpack.AutomaticPrefetchPlugin()],
};
You are reading the documentation for webpack 5, the latest release. Read the webpack 4 documentation here. See the migration guide for upgrading to webpack 5.