1.0.3 • Published 6 months ago

rollup-plugin-auto-reload v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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

OptionValuesDefault
hosthost name or IP address as stringlocalhost
portany number between 0 - 65,5350

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.

1.0.3

6 months ago

1.0.2

1 year ago

1.0.1

1 year ago