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:
- Clone the project.
npm install
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.