Skip to main content

ReactSSRWebpackPlugin

ReactSSRWebpackPlugin

A webpack plugin outputs server side rendering chunks

new ReactSSRWebpackPlugin(options, config)

ParamTypeDescription
optionsOptionsThe webpack-like options but it only supports entry, resolve and resolveLoader
configConfigThe plugin config

ReactSSRWebpackPlugin~Options : Object

Properties

NameTypeDescription
entryObjectSee webpack
resolveObjectSee webpack
resolveLoaderObjectSee webpack

ReactSSRWebpackPlugin~Config : Object

Properties

NameTypeDescription
algorithmstringThe hash algorithm for subresouce integrity Default is sha256
nodebooleanNodeTargetPlugin 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
routesArray.<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 }]
versionstringmanifest.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

NameTypeDescription
entryEntryThis allows you to define which entry will use to perform server side rendering when the pattern is matched
patternstringSee path-to-regexp to define your pattern

Route~Entry ⇒ string

Returns: string - The entry chunk name

ParamTypeDescription
regexObjectRegular expression object. See path-to-regexp