File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
src/Microsoft.AspNetCore.SpaServices/Webpack Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,9 @@ public static void UseWebpackDevMiddleware(
7878 // Ideally, this would be relative to the application's PathBase (so it could work in virtual directories)
7979 // but it's not clear that such information exists during application startup, as opposed to within the context
8080 // of a request.
81- var hmrEndpoint = "/__webpack_hmr" ;
81+ var hmrEndpoint = ! string . IsNullOrEmpty ( options . HotModuleReplacementEndpoint )
82+ ? options . HotModuleReplacementEndpoint
83+ : "/__webpack_hmr" ; // Matches webpack's built-in default
8284
8385 // Tell Node to start the server hosting webpack-dev-middleware
8486 var devServerOptions = new
Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ public class WebpackDevMiddlewareOptions
1313 /// </summary>
1414 public bool HotModuleReplacement { get ; set ; }
1515
16+ /// <summary>
17+ /// If set, overrides the URL that Webpack's client-side code will connect to when listening for updates.
18+ /// This must be a root-relative URL similar to "/__webpack_hmr" (which is the default endpoint).
19+ /// </summary>
20+ public string HotModuleReplacementEndpoint { get ; set ; }
21+
1622 /// <summary>
1723 /// Overrides the internal port number that client-side HMR code will connect to.
1824 /// </summary>
You can’t perform that action at this time.
0 commit comments