Skip to main content
Deno 2 is finally here 🎉️
Learn more

Rollup plugin LiveReload

Software License Issues Typescript Style Guide Deno.land Latest Version

Overview

This modules made for deno-rollup Next-generation ES module bundler for Deno ported from Rollup.

deno-rollup-plugin-livereload is a Deno rebuilt/port from rollup-plugin-livereload. Automatically reload your browser when the filesystem changes.

Import

import livereload from 'https://deno.land/x/drollup_plugin_livereload@0.1.0/mod.ts'

Usage

// rollup.config.js

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

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

// rollup.config.js
import serve from 'https://deno.land/x/drollup_plugin_serve/mod.ts'
import livereload from 'https://deno.land/x/drollup_plugin_livereload/mod.ts'

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({
  base: ['dist'],
  verbose: false, // Disable console output

  // other livereload options
  exclude: ['*.ts']
})

Options are always passed to new LiveReload()

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Contributions and feedback are very welcome.

Credits

License

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