https://github.com/saqqdy/vue-lazy-compile-webpack-plugin
Plugin that saves a tremendous amount of time. forked from liximomo/lazy-compile-webpack-plugin
https://github.com/saqqdy/vue-lazy-compile-webpack-plugin
Last synced: 5 months ago
JSON representation
Plugin that saves a tremendous amount of time. forked from liximomo/lazy-compile-webpack-plugin
- Host: GitHub
- URL: https://github.com/saqqdy/vue-lazy-compile-webpack-plugin
- Owner: saqqdy
- License: mit
- Created: 2020-09-03T03:46:40.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-26T02:26:45.000Z (almost 3 years ago)
- Last Synced: 2025-04-01T07:37:21.061Z (7 months ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
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 vue-lazy-compile-webpack-plugin# yarn
yarn add -D vue-lazy-compile-webpack-plugin
```## Usage
```js
const LazyCompilePlugin = require('vue-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\(\)/
],
});
```