Package detail

rollup-plugin-livereload

thgh232kMIT2.0.5

Rollup plugin for LiveReload that watches the bundle and reloads the page on change

rollup, rollup-plugin, livereload, lr

readme

Rollup plugin LiveReload

Software License Issues JavaScript Style Guide NPM Latest Version

Installation

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

Usage

// rollup.config.js
import livereload from 'rollup-plugin-livereload'

export default {
  entry: 'entry.js',
  dest: 'bundle.js',
  plugins: [livereload()],
}

To make it a real dev-server, combine this plugin with rollup-plugin-serve.

// rollup.config.js
import serve from 'rollup-plugin-serve'
import livereload from 'rollup-plugin-livereload'

export default {
  entry: 'entry.js',
  dest: 'bundle.js',
  plugins: [
    serve(), // index.html should be in root of project
    livereload(),
  ],
}

Options

By default, it watches the current directory. If you also have css output, pass the folder to which the build files are written.

livereload('dist')

// --- OR ---

livereload({
  watch: 'dist',
  verbose: false, // Disable console output

  // other livereload options
  port: 12345,
  delay: 300,
  https: {
      key: fs.readFileSync('keys/agent2-key.pem'),
      cert: fs.readFileSync('keys/agent2-cert.pem')
  }
})

Options are always passed to livereload.createServer()

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

Credits

License

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

changelog

Changelog

All notable changes to rollup-plugin-livereload will be documented in this file.

Unreleased

2.0.0 - 2020-08-28

Removed

  • Dropped support for Node.js below v8.3

Changed

  • Will automatically find an available port if the requested one is in use. (#23) @appsforartists

1.3.0 - 2020-04-28

Changed

  • Fix codesandbox support

[1.2.0] - 2020-03-19

Added

  • Add support for IE8 (#43) @thgh

Changed

  • Only keep 1 server instance running (#33) @rixo

[1.1.0] - 2020-03-19

Added

  • Add support for codesandbox.io (#37) @jakobrosenberg

[1.0.4] - 2019-10-05

Changed

  • Update livereload to 0.8.0 || ^0.8.2

[1.0.0] - 2019-01-27

Changed

  • Add support for Rollup 1 @yohangz

0.0.1 - 2016-09-24

Added

  • Initial version