mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Further stylistic tweaks
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.PlatformAbstractions;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
namespace Microsoft.AspNetCore.NodeServices
|
||||
{
|
||||
using System;
|
||||
|
||||
public static class Configuration
|
||||
{
|
||||
private static readonly string[] DefaultWatchFileExtensions = {".js", ".jsx", ".ts", ".tsx", ".json", ".html"};
|
||||
@@ -20,15 +18,18 @@ namespace Microsoft.AspNetCore.NodeServices
|
||||
=> AddNodeServices(serviceCollection, DefaultOptions);
|
||||
|
||||
public static void AddNodeServices(this IServiceCollection serviceCollection, NodeServicesOptions options)
|
||||
=> serviceCollection.AddSingleton(typeof(INodeServices), serviceProvider =>
|
||||
{
|
||||
serviceCollection.AddSingleton(typeof(INodeServices), serviceProvider =>
|
||||
{
|
||||
var hostEnv = serviceProvider.GetRequiredService<IHostingEnvironment>();
|
||||
if (string.IsNullOrEmpty(options.ProjectPath))
|
||||
{
|
||||
options.ProjectPath = hostEnv.ContentRootPath;
|
||||
}
|
||||
|
||||
return CreateNodeServices(options);
|
||||
});
|
||||
}
|
||||
|
||||
public static INodeServices CreateNodeServices(NodeServicesOptions options)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user