mirror of
https://github.com/gregberge/loadable-components.git
synced 2026-01-18 15:12:26 +00:00
1.1 KiB
1.1 KiB
@loadable/webpack-plugin
This plugin is required only if you use Server Side Rendering in your application. See @loadable/server for more information.
Install
npm install --save-dev @loadable/webpack-plugin
Usage
webpack.config.js
const LoadablePlugin = require('@loadable/webpack-plugin')
module.exports = {
plugins: [new LoadablePlugin()],
}
API
LoadablePlugin
Create a webpack loadable plugin.
| Arguments | Description |
|---|---|
options |
Optional options |
options.filename |
Stats filename (default to loadable-stats.json) |
options.writeToDisk |
Always write assets to disk (default to false) |
new LoadablePlugin({ filename: 'stats.json', writeToDisk: true })
Writing file to disk can be useful if you are using
razzleorwebpack-dev-server.
License
MIT