@@ -23,6 +23,7 @@ var yargs = require("yargs")
23
23
24
24
require ( "webpack/bin/config-yargs" ) ( yargs ) ;
25
25
26
+ var ADVANCED_GROUP = "Advanced options:" ;
26
27
var DISPLAY_GROUP = "Stats options:" ;
27
28
var SSL_GROUP = "SSL options:" ;
28
29
var CONNECTION_GROUP = "Connection options:" ;
@@ -38,6 +39,11 @@ yargs.options({
38
39
default : true ,
39
40
describe : "Inline mode"
40
41
} ,
42
+ "hot-only" : {
43
+ type : "boolean" ,
44
+ describe : "Do not refresh page if HMR fails" ,
45
+ group : ADVANCED_GROUP
46
+ } ,
41
47
"stdin" : {
42
48
type : "boolean" ,
43
49
describe : "close when stdin ends"
@@ -169,6 +175,9 @@ function processOptions(wpOpt) {
169
175
if ( ! options . hot )
170
176
options . hot = argv [ "hot" ] ;
171
177
178
+ if ( ! options . hotOnly )
179
+ options . hotOnly = argv [ "hot-only" ] ;
180
+
172
181
if ( argv [ "content-base" ] ) {
173
182
options . contentBase = argv [ "content-base" ] ;
174
183
if ( / ^ [ 0 - 9 ] $ / . test ( options . contentBase ) )
@@ -231,8 +240,11 @@ function processOptions(wpOpt) {
231
240
if ( options . inline !== false ) {
232
241
var devClient = [ require . resolve ( "../client/" ) + "?" + protocol + "://" + ( options . public || ( options . host + ":" + options . port ) ) ] ;
233
242
234
- if ( options . hot )
243
+ if ( options . hotOnly )
244
+ devClient . push ( "webpack/hot/only-dev-server" ) ;
245
+ else if ( options . hot )
235
246
devClient . push ( "webpack/hot/dev-server" ) ;
247
+
236
248
[ ] . concat ( wpOpt ) . forEach ( function ( wpOpt ) {
237
249
if ( typeof wpOpt . entry === "object" && ! Array . isArray ( wpOpt . entry ) ) {
238
250
Object . keys ( wpOpt . entry ) . forEach ( function ( key ) {
0 commit comments