🍣 A Rollup plugin which adds the LiveReload client for use during development
npm install --save-dev rollup-plugin-livereload-client
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.
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.
Type: Number
Default: 35729
Specifies the port number that the separate livereload server is running on.
Please see CHANGELOG for more information what has changed recently.
Contributions and feedback are very welcome.
To get it running:
- Clone the project.
npm installnpm run build
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.
The MIT License (MIT). Please see License File for more information.