rollup-plugin-auto-reload
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Rollup Auto Reload Plugin

npm License: MIT Build

This rollup plugin automatically reloads the web page when rollup is running in watch mode and any changes are made on bundles. It works on any server as well as on the local file system.

Install

npm i --save-dev rollup-plugin-auto-reload
yarn add --dev rollup-plugin-auto-reload

Options

Option Values Default
host host name or IP address as string localhost
port any number between 0 - 65,535 0

Host

The host can be any legal host name or IP address. If you run your server and client on the same machine, you can keep the default value localhost.

Port

The port can be any legal port number between 0 - 65,535. If the port is set to 0, a random available port will be used.

Getting Started

  1. Install the plugin:
npm i --save-dev rollup-plugin-auto-reload
yarn add --dev rollup-plugin-auto-reload
  1. Add the plugin in your rollup.config.js or rollup.config.ts:
import { autoReload } from "rollup-plugin-auto-reload"

export default {
  input: "src/index.js",
  output: {
    file: "dist/index.js",
    format: "iife",
  },
  plugins: [
    autoReload({ /* place your options here */ })
  ],
}

Example

You can find a fully working minimal example project in the demo folder.

Package Sidebar

Install

npm i rollup-plugin-auto-reload

Weekly Downloads

4

Version

1.0.3

License

MIT

Unpacked Size

61.4 kB

Total Files

9

Last publish

Collaborators

  • pmwmedia