Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liximomo/lazy-compile-webpack-plugin
Boost webpack startup time by lazily compiling dynamic imports
https://github.com/liximomo/lazy-compile-webpack-plugin
compile dynamic imports lazy lazy-compile-webpack-plugin webpack
Last synced: 5 days ago
JSON representation
Boost webpack startup time by lazily compiling dynamic imports
- Host: GitHub
- URL: https://github.com/liximomo/lazy-compile-webpack-plugin
- Owner: liximomo
- License: mit
- Created: 2019-07-10T09:13:14.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-23T08:11:34.000Z (9 months ago)
- Last Synced: 2024-10-29T21:47:41.666Z (14 days ago)
- Topics: compile, dynamic, imports, lazy, lazy-compile-webpack-plugin, webpack
- Language: JavaScript
- Homepage:
- Size: 1.17 MB
- Stars: 141
- Watchers: 5
- Forks: 11
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Why
Starting the development server is taking you a long time when the codebase is large. You have tried dynamic imports, it only does a load-on-demand, the whole project was still been compiled. We don't want to wait a couple of minutes for a simple modification. People don't waste time for the things they have never used!
## Install
```sh
# npm
npm i -D lazy-compile-webpack-plugin# yarn
yarn add -D lazy-compile-webpack-plugin
```## Usage
```js
const LazyCompilePlugin = require('lazy-compile-webpack-plugin');module.exports = {
entry: 'index.js',
output: {
path: __dirname + '/dist',
filename: 'bundle.js',
},
plugins: [new LazyCompilePlugin()],
};
```## Options
| Name | Type | Default | Description |
| :-----------------------------------------------: | :---------------------: | :---------: | :------------------------------------------------------- |
| **[`refreshAfterCompile`](#refreshAfterCompile)** | `boolean` | `false` | Enable/Disable _page refresh_ when compilation is finish |
| **[`ignores`](#ignores)** | `RegExp[] \| Function[]` | `undefined` | Request to be ignored from lazy compiler |### `refreshAfterCompile`
Type: `boolean`
Default: `false`Set `false` for a seamless dev experience.
### `ignores`
Type: `RegExp[] | ((request: string, wpModule: object) => boolean)`
Default: `undefined`Request to be ignored from lazy compiler, `html-webpack-plugin` is always ignored.
Specifically, an Angular app should enable this option like following:
```js
new LazyCompileWebpackPlugin({
ignores: [
/\b(html|raw|to-string)-loader\b/,
/\bexports-loader[^?]*\?exports\.toString\(\)/
],
});
```