rollup-plugin-livereload

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

MIT 26 个版本
安装
npm install rollup-plugin-livereload
yarn add rollup-plugin-livereload
pnpm add rollup-plugin-livereload
bun add rollup-plugin-livereload
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.

版本列表
2.0.5 2021-06-29
2.0.4 2021-06-29
2.0.3 2021-06-29
2.0.2 2021-06-29
2.0.1 2021-06-29
2.0.0-0 2020-08-27
2.0.0 2020-08-27
1.3.0 2020-04-28
1.2.0 2020-04-11
1.1.0 2020-03-19
1.0.4 2019-10-05
1.0.3 2019-09-23
1.0.2 2019-09-23
1.0.1 2019-06-13
1.0.0 2019-01-27
0.6.0 2017-08-21
0.5.0 2017-08-21
0.4.0 2016-12-08
0.3.1 2016-11-05
0.3.0 2016-10-30
0.2.0 2016-10-28
0.1.0 2016-09-29
0.0.4 2016-09-27
0.0.3 2016-09-24
0.0.2 2016-09-24
0.0.1 2016-09-24