mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
In HMR, don't rely on default JsonSerializer settings. Fixes #688
This commit is contained in:
@@ -15,6 +15,12 @@ namespace Microsoft.AspNetCore.Builder
|
|||||||
{
|
{
|
||||||
private const string DefaultConfigFile = "webpack.config.js";
|
private const string DefaultConfigFile = "webpack.config.js";
|
||||||
|
|
||||||
|
private static readonly JsonSerializerSettings jsonSerializerSettings = new JsonSerializerSettings
|
||||||
|
{
|
||||||
|
ContractResolver = new CamelCasePropertyNamesContractResolver(),
|
||||||
|
TypeNameHandling = TypeNameHandling.None
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enables Webpack dev middleware support. This hosts an instance of the Webpack compiler in memory
|
/// Enables Webpack dev middleware support. This hosts an instance of the Webpack compiler in memory
|
||||||
/// in your application so that you can always serve up-to-date Webpack-built resources without having
|
/// in your application so that you can always serve up-to-date Webpack-built resources without having
|
||||||
@@ -88,7 +94,7 @@ namespace Microsoft.AspNetCore.Builder
|
|||||||
};
|
};
|
||||||
var devServerInfo =
|
var devServerInfo =
|
||||||
nodeServices.InvokeExportAsync<WebpackDevServerInfo>(nodeScript.FileName, "createWebpackDevServer",
|
nodeServices.InvokeExportAsync<WebpackDevServerInfo>(nodeScript.FileName, "createWebpackDevServer",
|
||||||
JsonConvert.SerializeObject(devServerOptions, new JsonSerializerSettings() { ContractResolver = new DefaultContractResolver() })).Result;
|
JsonConvert.SerializeObject(devServerOptions, jsonSerializerSettings)).Result;
|
||||||
|
|
||||||
// If we're talking to an older version of aspnet-webpack, it will return only a single PublicPath,
|
// If we're talking to an older version of aspnet-webpack, it will return only a single PublicPath,
|
||||||
// not an array of PublicPaths. Handle that scenario.
|
// not an array of PublicPaths. Handle that scenario.
|
||||||
|
|||||||
Reference in New Issue
Block a user