question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

rollup-plugin-livereload can`t watch html file and reload it when html file was changed!

See original GitHub issue

my 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
aminnairicommented, Nov 24, 2019

Is this issue still being worked on? I’m having a similar issue for files that are not the input.

0reactions
thghcommented, Apr 11, 2020

This is probably fixed in v1.2.0, will close for now. Always welcome to update with more info!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found