This package has been deprecated

Author message:

This repository has been archived by the owner. It is now read-only.

webpack-plugin-prerender

1.1.0 • Public • Published

webpack-plugin-prerender

Prerender HTML and reduce JS while bundling.

Install

$ npm install --save-dev webpack-plugin-prerender

Usage

Make sure, that .html get emitted. Use html-webpack-plugin for example.

// webpack.config.js
const PreRenderPlugin = require("webpack-plugin-prerender");
 
module.exports = {
  // ...
  plugins: [
    new PreRenderPlugin({
      externals: ["framework"],
      test: /\.m?(ts|js)x?$/,
      functionCalls: ["render"],
      patterns: [],
      exclude: /node_modules/,
      browser: "chromium",
    }),
  ],
};

API

options.externals

Type: Array<libraries: string>
Default: []

Use the same externals Array that is used for webpack

options.test

Type: RegExp
Default: /\.js\$/

Determines which JS/TS files should be stripped.

options.functionCalls

Type: Array<functionNames: string>
Default: []

Which functions should be removed from the bundle.

options.patterns

Type: Array<{ regex: RegExp, value: string }>
Default: []

Replace further code from the asset.

options.exclude

Type: RegExp
Default: /node_modules/

Which asset files you do not want to change.

options.browser

Type: Browser from Playwright: string
Default: chromium

Possible values are ['chromium', 'firefox', 'webkit'].

Package Sidebar

Install

npm i webpack-plugin-prerender

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

23 kB

Total Files

11

Last publish

Collaborators

  • krutsch