Giter Site home page Giter Site logo

changing index.html when running dev server seems doing nothing, the page only show the change after pressing refresh button . about webpack-boilerplate HOT 4 OPEN

taniarascia avatar taniarascia commented on May 31, 2024
changing index.html when running dev server seems doing nothing, the page only show the change after pressing refresh button .

from webpack-boilerplate.

Comments (4)

SimplySayHi avatar SimplySayHi commented on May 31, 2024 5

@mizok in my case it doesn't work with:
watchFiles: ['*.html']

I had to use:
watchFiles: ['src/*.html']
and to watch sub-folders too, better:
watchFiles: ['src/**/*.html']

from webpack-boilerplate.

mizok avatar mizok commented on May 31, 2024

I found that if I change the HMR setting in webpack.dev.js to false solve this problem , but this also kill the HMR :(
Just can't get any further.

from webpack-boilerplate.

mizok avatar mizok commented on May 31, 2024

Finally found the solution.
watchFiles option is needed
just add this in devServer setting

watchFiles: ['*.html']

And maybe update webpack-dev-server to @latest, since I am not sure when did those webpack DEVs create this watchFiles option

npm i -D webpack-dev-server@latest

You can check the solution here
webpack/webpack-dev-server#3794

from webpack-boilerplate.

mizok avatar mizok commented on May 31, 2024

@SimplySayHi

Sure you are right. :D

That was because my entry html template file is at root of folder, in your condition it must be watchFiles: ['src/*.html'] or watchFiles: ['src/**/*.html'].

Thanks for the correction.

from webpack-boilerplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.