Gem 一覧へ戻る
thgh/rollup-plugin-livereload(新しいタブで開きます)
主要言語: TypeScript
LiveReload your Rollup bundle!
- star 数
- 161
- watcher 数
- 3
- fork 数
- 43
- issue 数
- 7
- 最終更新
- 2024/04/04
主要言語: TypeScript
LiveReload your Rollup bundle!
npm install --save-dev rollup-plugin-livereload
// 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.
// 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(), ], }
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().
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')
}
})
Please see CHANGELOG for more information what has changed recently.
Contributions and feedback are very welcome.
To get it running:
npm installnpm run buildThe MIT License (MIT). Please see License File for more information.