Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
444 views
in Technique[技术] by (71.8m points)

WebPack Dev Server does not live reload my second HTML page when changing my SCSS, but live reloads when changing my HTML or JS file

Webpack does not live reload with new compiled SCSS code. It live reloads when I change the HTML. It also live reloads when I change the JS file.

The recent change I did was to add a second HtmlWebpackPlugin, so I can work on the next HTML page. Here is a step by step explanation of where the problem happens:

What I did Webpack Dev Server
edit script.js live realod updates site
edit archive-book.html live reload updates site
edit stylesheet for archive-book.html live reload does NOT update site
edit post.html live reload updates site
edit stylesheet for post.html live reload updates site
hard refresh browser does not update site with new stylesheet
question from:https://stackoverflow.com/questions/65904611/webpack-dev-server-does-not-live-reload-my-second-html-page-when-changing-my-scs

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I have found the problem by now:

Inside my SCSS file I was importing another stylesheet, and I mistyped it. Instead of Style I wrote STyle.

Funny thing is, it still recognised it. When I started the server, it showed me the correct stylesheet, the one I imported. When I changed one thing, it updated it as well. Only after that, it didn't update anything else.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...