Design review: Change AddNodeServices to take an Action<NodeServicesOptions> like other aspects of MVC DI config

This commit is contained in:
SteveSandersonMS
2016-09-01 17:46:59 +01:00
parent f04fb8c421
commit f0d954b2a6
11 changed files with 150 additions and 141 deletions

View File

@@ -40,12 +40,9 @@ namespace Microsoft.AspNetCore.Builder
// because it must *not* restart when files change (if it did, you'd lose all the benefits of Webpack
// middleware). And since this is a dev-time-only feature, it doesn't matter if the default transport isn't
// as fast as some theoretical future alternative.
var nodeServices = Configuration.CreateNodeServices(
appBuilder.ApplicationServices,
new NodeServicesOptions
{
WatchFileExtensions = new string[] { } // Don't watch anything
});
var nodeServicesOptions = new NodeServicesOptions(appBuilder.ApplicationServices);
nodeServicesOptions.WatchFileExtensions = new string[] {}; // Don't watch anything
var nodeServices = NodeServicesFactory.CreateNodeServices(nodeServicesOptions);
// Get a filename matching the middleware Node script
var script = EmbeddedResourceReader.Read(typeof(WebpackDevMiddleware),