ReactSSRWebpackPlugin
ReactSSRWebpackPlugin
A webpack plugin outputs server side rendering chunks
new ReactSSRWebpackPlugin(options, config)
| Param | Type | Description |
|---|---|---|
| options | Options | The webpack-like options but it only supports entry, resolve and resolveLoader |
| config | Config | The plugin config |
ReactSSRWebpackPlugin~Options : Object
Properties
| Name | Type | Description |
|---|---|---|
| entry | Object | See webpack |
| resolve | Object | See webpack |
| resolveLoader | Object | See webpack |
ReactSSRWebpackPlugin~Config : Object
Properties
| Name | Type | Description |
|---|---|---|
| algorithm | string | The hash algorithm for subresouce integrity Default is sha256 |
| node | boolean | NodeTargetPlugin will apply when the flag is true. Otherwise, you have to polyfill node.js core module. You may need this when the runtime environment is cloudflare webworker Default is true |
| routes | Array.<Route> | This allows you to use a specific entry chunk based on the route to perform server side rendering. This is a better solution for historyApiFallback Default is [{ "pattern": "/:name", "entry": ({param}) => param.name }] |
| version | string | manifest.json will be generated by default. This allows you to pass the build number from CI environment variable Default is manifest |
ReactSSRWebpackPlugin~Route : Object
Properties
| Name | Type | Description |
|---|---|---|
| entry | Entry | This allows you to define which entry will use to perform server side rendering when the pattern is matched |
| pattern | string | See path-to-regexp to define your pattern |
Route~Entry ⇒ string
Returns: string - The entry chunk name
| Param | Type | Description |
|---|---|---|
| regex | Object | Regular expression object. See path-to-regexp |