rollup-plugin-livereload-client

0.0.2 • Public • Published

rollup-plugin-livereload-client

🍣 A Rollup plugin which adds the LiveReload client for use during development

Installation

npm install --save-dev rollup-plugin-livereload-client

Usage

This plugin is meant to be used with plugins that output html, like @rollup/plugin-html.

// rollup.config.js
import html from "@rollup/plugin-html";
import livereloadClient from "rollup-plugin-livereload-client";
 
const development = process.env.ROLLUP_WATCH;
 
export default {
  entry: "entry.js",
  output: {
    dir: "build",
  },
  plugins: [html(), livereloadClient({ include: development })],
};

index.html will be modified to include a script tag to load livereload.js. Which will also be copied into the build directory.

Options

include

Type: Boolean
Default: true

Specifies whether to include the client. When true, livereload.js is copied into the output.dir and a <script> tag to load livereload.js is injected into index.html. Set to false in production so livereload is not included in the build.

port

Type: Number
Default: 35729

Specifies the port number that the separate livereload server is running on.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Contributions and feedback are very welcome.

To get it running:

  1. Clone the project.
  2. npm install
  3. npm run build

Attribution

This plugin is similar to rollup-plugin-livereload by Thomas Ghysels. The main difference being, this is the client only. I needed this to integrate with the LiveReload server already running in Spring Boot.

Credits

License

The MIT License (MIT). Please see License File for more information.

Package Sidebar

Install

npm i rollup-plugin-livereload-client

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

11.5 kB

Total Files

8

Last publish

Collaborators

  • wlindner
  • refactornator