Webpack plugin to default all dynamic imports to eager-mode as a way to speed up non-production builds for large projects.
This plugin takes inspiration from work done with @TheLarkInn on webpack #8644. It defaults all dynamic imports to eager
mode, to relieve webpack of the expensive cost of having to determine what modules go into what emitted bundles.
Since that work (and webpack 5) are not yet released, this plugin is designed to deliver that same optimization to webpack v4.
npm i -D eager-imports-webpack-plugin
Or using yarn
yarn add -D eager-imports-webpack-plugin
import EagerImportsPlugin from 'eager-imports-webpack-plugin';
const webpackConfig = {
plugins: [
new EagerImportsPlugin(),
// other plugins ...
]
// other webpack config ...
}