mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
In SpaServices, add new HotModuleReplacementEndpoint option on HMR config. Fixes #579.
This commit is contained in:
@@ -78,7 +78,9 @@ namespace Microsoft.AspNetCore.Builder
|
|||||||
// Ideally, this would be relative to the application's PathBase (so it could work in virtual directories)
|
// Ideally, this would be relative to the application's PathBase (so it could work in virtual directories)
|
||||||
// but it's not clear that such information exists during application startup, as opposed to within the context
|
// but it's not clear that such information exists during application startup, as opposed to within the context
|
||||||
// of a request.
|
// of a request.
|
||||||
var hmrEndpoint = "/__webpack_hmr";
|
var hmrEndpoint = !string.IsNullOrEmpty(options.HotModuleReplacementEndpoint)
|
||||||
|
? options.HotModuleReplacementEndpoint
|
||||||
|
: "/__webpack_hmr"; // Matches webpack's built-in default
|
||||||
|
|
||||||
// Tell Node to start the server hosting webpack-dev-middleware
|
// Tell Node to start the server hosting webpack-dev-middleware
|
||||||
var devServerOptions = new
|
var devServerOptions = new
|
||||||
|
|||||||
@@ -13,6 +13,12 @@ namespace Microsoft.AspNetCore.SpaServices.Webpack
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool HotModuleReplacement { get; set; }
|
public bool HotModuleReplacement { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// If set, overrides the URL that Webpack's client-side code will connect to when listening for updates.
|
||||||
|
/// This must be a root-relative URL similar to "/__webpack_hmr" (which is the default endpoint).
|
||||||
|
/// </summary>
|
||||||
|
public string HotModuleReplacementEndpoint { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Overrides the internal port number that client-side HMR code will connect to.
|
/// Overrides the internal port number that client-side HMR code will connect to.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user