This is a Pre-Rendering plugin.


$ yarn add @umijs/plugin-prerender --dev


Configured in .umirc.js:

export default {
  ssr: true,
  manifest: {},
  plugins: [['@umijs/plugin-prerender']],

Configuration items

All features are turned off by default and will be enabled if there is a true value.


  • Type: string[]

exclude routes that aren't prerendered. e.g. [ '/user', '/about', '/news/:id' ]

runInMockContext (TODO)

  • Type: Boolean

mock window browser variable environment in Node Server.

Project code is best compatible with Server-Side rendering, add `typeof bar !== 'undefined'` judgment when using in the Server-side render lifecycle where `bar` is a browser variable or method. :::


  • Type: Boolean

Whether the pre-rendered html is visible or not, avoiding page flicker under dynamic data. just use for page seo.

Last Updated: 6/20/2019, 3:49:05 PM