Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thgh/rollup-plugin-livereload
LiveReload your Rollup bundle!
https://github.com/thgh/rollup-plugin-livereload
Last synced: 2 days ago
JSON representation
LiveReload your Rollup bundle!
- Host: GitHub
- URL: https://github.com/thgh/rollup-plugin-livereload
- Owner: thgh
- License: mit
- Created: 2016-09-24T12:56:43.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-04-04T01:13:27.000Z (8 months ago)
- Last Synced: 2024-12-08T22:34:23.257Z (4 days ago)
- Language: TypeScript
- Size: 211 KB
- Stars: 161
- Watchers: 4
- Forks: 45
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome - live-reload - Live reloading for a bundle. (Plugins / Output)
README
# Rollup plugin LiveReload
## Installation
```
npm install --save-dev rollup-plugin-livereload
```## Usage
```js
// rollup.config.js
import livereload from 'rollup-plugin-livereload'export default {
input: 'entry.js',
output: { file: 'bundle.js' },
plugins: [livereload()],
}
```To make it a real dev-server, combine this plugin with [rollup-plugin-serve].
```js
// rollup.config.js
import serve from 'rollup-plugin-serve'
import livereload from 'rollup-plugin-livereload'export default {
input: 'entry.js',
output: { file: '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.
This plugin supports the following options:
- `clientUrl`: provide an alternative URL to the `livereload.js` script/resource. This URL is always preferred over all other generated URLs.
- `clientHostname`: alternative hostname used instead of `localhost` or the site's current host, where the bundle is fetched from. Use this option when you include your bundle from a different host.All remaining options are passed to [`livereload.createServer()`][livereload].
Example:
```
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')
}
})
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) 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
- [Thomas Ghysels](https://github.com/thgh)
- [All Contributors][link-contributors]## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.
[link-author]: https://github.com/thgh
[link-contributors]: ../../contributors
[livereload]: https://www.npmjs.com/package/livereload
[rollup-plugin-serve]: https://www.npmjs.com/package/rollup-plugin-serve