Rollup plugin LiveReload
Installation
npm install --save-dev rollup-plugin-livereload
Usage
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.
import serve from 'rollup-plugin-serve'
import livereload from 'rollup-plugin-livereload'
export default {
entry: 'entry.js',
dest: 'bundle.js',
plugins: [
serve(),
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:
- Clone the project.
npm install
npm run build
Credits
License
The MIT License (MIT). Please see License File for more information.