1.8.4 • Published 4 years ago

@umijs/plugin-prerender v1.8.4

Weekly downloads
13
License
MIT
Repository
github
Last release
4 years ago

@umijs/plugin-prerender

NPM version NPM downloads

A plugin for Umijs Pre Render.

Usage

Configure in .umirc.js,

export default {
  plugins: [['@umijs/plugin-prerender', options]],
};

Options

extends IConfig.

export interface IOpts extends IConfig {
  include?: string[];
  exclude?: string[];
  /** extra routes, for dynamic routes */
  extra?: string[];
  /** disable ssr BOM polyfill */
  disablePolyfill?: boolean;
  // htmlSuffix
  htmlSuffix?: boolean;
  runInMockContext?: object | (() => object);
}
  • include: include routes to pre render
  • exclude: exclude routes not pre render
  • disablePolyfill: disable ssr-polyfill for client window object
  • runInMockContext: you mock global
  • staticMarkup: use renderToStaticMarkup, default use renderToString
  • htmlSuffix: route Enable the .html suffix.

TODO

  • support dynamicImport for chunkMap assets, render chunk styles and prefetch scripts.
  • friendly log shows like ▶ start, ☒ complete, ✔ success
  • Check server-side render content hash code, whether help re-render if client not sync with server.
  • runInMockContext for users can custom your global variables.
  • use jsdom for mock Bom in Node env.
  • support react-document-title, react-helmet to dynamic title.
  • dynamic route prerender
  • more test cases, add coverage badge
  • register command umi render-preview to run a static server for prerendered site.

LICENSE

MIT

1.8.4

4 years ago

1.8.3

4 years ago

1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.8

4 years ago

1.5.7

4 years ago

1.5.6

5 years ago

1.5.5

5 years ago

1.5.4

5 years ago

1.5.3

5 years ago

1.5.2

5 years ago

1.5.0

5 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.5.1

5 years ago

1.4.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago