eager-imports-webpack-plugin

Webpack plugin to default all dynamic imports to eager-mode as a way to speed up non-production builds for large projects.

Downloads
5.4K
Stars
19
Committers
2

eager-import-webpack-plugin

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.

This should never be used in production builds

Installation

npm i -D eager-imports-webpack-plugin

Or using yarn

yarn add -D eager-imports-webpack-plugin

Usage

import EagerImportsPlugin from 'eager-imports-webpack-plugin';

const webpackConfig = {
    plugins: [
        new EagerImportsPlugin(),
        // other plugins ...
    ]
    // other webpack config ...
}