fix(webpack): fix middleware to specifically serialize options as non-camecased

This commit is contained in:
Stephen Lautier
2017-07-31 17:58:48 +02:00
committed by Steve Sanderson
parent 372e597f34
commit fc12d722b8

View File

@@ -4,6 +4,7 @@ using System.Threading;
using Microsoft.AspNetCore.NodeServices;
using Microsoft.AspNetCore.SpaServices.Webpack;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Microsoft.AspNetCore.Builder
{
@@ -87,7 +88,7 @@ namespace Microsoft.AspNetCore.Builder
};
var devServerInfo =
nodeServices.InvokeExportAsync<WebpackDevServerInfo>(nodeScript.FileName, "createWebpackDevServer",
JsonConvert.SerializeObject(devServerOptions)).Result;
JsonConvert.SerializeObject(devServerOptions, new JsonSerializerSettings() { ContractResolver = new DefaultContractResolver() })).Result;
// 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.