Skip to content
LiveReload your Rollup bundle!
Branch: master
Clone or download
thgh Merge pull request #21 from TomasM/patch-1
location -> window.location
Latest commit 75c44df Jul 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src location -> window.location Jul 10, 2019
.gitignore Initial commit Sep 24, 2016
.prettierrc Remove unused rollup plugins Jan 27, 2019
CHANGELOG.md Initial commit Sep 24, 2016
LICENSE.md Add license Sep 24, 2016
README.md fix https example in readme Jun 14, 2019
package.json v1.0.1 Jun 13, 2019
rollup.config.js Remove unused rollup plugins Jan 27, 2019
yarn.lock Update livereload to 0.8.0 Jun 13, 2019

README.md

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
  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.

You can’t perform that action at this time.