mirror of
https://github.com/gregberge/loadable-components.git
synced 2026-01-25 15:24:15 +00:00
25 lines
1.0 KiB
Plaintext
25 lines
1.0 KiB
Plaintext
---
|
|
menu: API
|
|
title: '@loadable/plugin'
|
|
order: 30
|
|
---
|
|
|
|
# @loadable/webpack-plugin
|
|
|
|
### LoadablePlugin
|
|
|
|
Create a webpack loadable plugin.
|
|
|
|
| Arguments | Description |
|
|
| ------------------------------ | ----------------------------------------------------------------------------------- |
|
|
| `options` | Optional options |
|
|
| `options.filename` | Stats filename (default to `loadable-stats.json`) |
|
|
| `options.writeToDisk` | Accepts `boolean` or `object`. Always write stats file to disk. Default to `false`. |
|
|
| `options.writeToDisk.filename` | Write assets to disk at given `filename` location |
|
|
|
|
```js
|
|
new LoadablePlugin({ filename: 'stats.json', writeToDisk: true })
|
|
```
|
|
|
|
> Writing file to disk can be useful if you are using `razzle` or `webpack-dev-server`.
|