Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

How to disable webpack dev server auto reload?

I know most people have the opposite problem but I actually want to disable the auto reload functionality.

This is how I run my server:

webpack-dev-server --open --progress

This is my dev server config:

devServer: {
    contentBase: 'app',
    port: 9005,
    hot: false,
    inline: false
}

Versions:

"webpack": "1.14.0",
"webpack-dev-middleware": "1.9.0",
"webpack-dev-server": "^1.16.2",
"webpack-hot-middleware": "2.13.2",
"webpack-md5-hash": "0.0.5"

With this setup webpack dev server opens the initial page as localhost:9005/webpack-dev-server/ with auto reload on (iframe mode). When I set inline to true then it opens localhost:9005 and auto reload is still on (inline mode => websockets).

Is there a way to disable auto reload entirely?

question from:https://stackoverflow.com/questions/41797704/how-to-disable-webpack-dev-server-auto-reload

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

1 Reply

0 votes
by (71.8m points)

Working solution for webpack 2.x and 3.x

config.devServer = {
    hot: false,
    inline: false,
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...