Package Exports
- lazy-compile-webpack-plugin
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lazy-compile-webpack-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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
# npm
npm i --save-dev lazy-compile-webpack-plugin
# yarn
yarn add --dev lazy-compile-webpack-plugin
Usage
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 |
boolean |
false |
Enable/Disable page refresh when compilation is finish |
ignores |
`RegExp[] | Function[]` | undefined |
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:
new LazyCompileWebpackPlugin({
ignores: [
/\b(html|raw|to-string)-loader\b/,
/\bexports-loader[^?]*\?exports\.toString\(\)/
],
});