rollup-plugin-livereload can`t watch html file and reload it when html file was changed!
See original GitHub issuemy config as follows:
import babel from 'rollup-plugin-babel';
import { uglify } from "rollup-plugin-uglify";
import serve from 'rollup-plugin-serve';
import livereload from 'rollup-plugin-livereload';
import postcss from 'rollup-plugin-postcss';
import discardComments from 'cssnano-preset-default';
import copy from 'rollup-plugin-copy-assets';
import htmlTemplate from 'rollup-plugin-bundle-html'
import module from './module.config.js'
const pro = process.env.NODE_ENV == 'production';
const dev = process.env.NODE_ENV == 'development';
let app = null;
for(var i in module) {
if (module[i].open) {
app = module[i];
break;
}
}
export default {
input:`${app.src}/js/app.js`,
output: {
file: `${app.dist}/js/app.js`,
format: 'umd'
},
plugins: [
dev && serve({
contentBase: `${app.dist}/`,
host: 'localhost'
}),
dev && livereload({
exts: ['html', 'js', 'less', 'css'],
watch: `${app.dist}/`
}),
postcss({
extensions:['.less'],
extract: `${app.dist}/css/bundle.css`,
minimize: pro ? discardComments : false
}),
copy({
assets: [
`${app.src}/imgs`
]
}),
htmlTemplate({
template: `${app.src}/index.html`,
dest: `${app.dist}`,
filename: 'index.html',
inject: 'body'
}),
babel({
exclude: 'node_modules/**',
plugins: ['external-helpers'],
externalHelpers: true
}),
pro && uglify(),
]
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Bundle Stylesheets and Add LiveReload With Rollup
Learn how to use the JavaScript bundler Rollup to process stylesheets using PostCSS and rebuild & reload files when changes are made in...
Read more >rollup-plugin-livereload - npm
Rollup plugin for LiveReload that watches the bundle and reloads the page on change. Latest version: 2.0.5, last published: 2 years ago.
Read more >Auto-reload browser when I save changes to html file, in ...
Is there a plugin for Google Chrome that will listen for changes to the file and auto refresh the page every time I...
Read more >Troubleshooting - Vite
If you are running Vite with WSL2, Vite cannot watch file changes in some conditions. See server.watch option. A full reload happens instead...
Read more >rollup-plugin-livereload - npm package - Snyk
Rollup plugin for LiveReload that watches the bundle and reloads the page on change For more information about how to use this package...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is this issue still being worked on? I’m having a similar issue for files that are not the
input
.This is probably fixed in v1.2.0, will close for now. Always welcome to update with more info!