mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Partial migration to ASP.NET Core 1.0 RC2 (done the core packages, plus the ES2015/Webpack samples, and the Angular2Spa template). Only verified it builds/runs on .NET Core - not checked on net451.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace ES2015Example.Controllers
|
namespace ES2015Example.Controllers
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,61 +1,28 @@
|
|||||||
using Microsoft.AspNet.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNet.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNet.NodeServices;
|
using Microsoft.AspNet.NodeServices;
|
||||||
using Microsoft.AspNet.Http;
|
|
||||||
using Microsoft.Extensions.PlatformAbstractions;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace ES2015Example
|
namespace ES2015Example
|
||||||
{
|
{
|
||||||
public class Startup
|
public class Startup
|
||||||
{
|
{
|
||||||
public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv)
|
// This method gets called by the runtime. Use this method to add services to the container.
|
||||||
{
|
|
||||||
// Setup configuration sources.
|
|
||||||
var builder = new ConfigurationBuilder()
|
|
||||||
.SetBasePath(appEnv.ApplicationBasePath)
|
|
||||||
.AddJsonFile("appsettings.json")
|
|
||||||
.AddEnvironmentVariables();
|
|
||||||
Configuration = builder.Build();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IConfigurationRoot Configuration { get; set; }
|
|
||||||
|
|
||||||
// This method gets called by the runtime.
|
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
// Add MVC services to the services container.
|
|
||||||
services.AddMvc();
|
services.AddMvc();
|
||||||
|
|
||||||
// Enable Node Services
|
// Enable Node Services
|
||||||
services.AddNodeServices();
|
services.AddNodeServices();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure is called after ConfigureServices is called.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, INodeServices nodeServices)
|
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHostingEnvironment env, INodeServices nodeServices)
|
||||||
{
|
{
|
||||||
loggerFactory.MinimumLevel = LogLevel.Warning;
|
app.UseDeveloperExceptionPage();
|
||||||
loggerFactory.AddConsole();
|
|
||||||
loggerFactory.AddDebug();
|
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
|
||||||
|
|
||||||
// Add the platform handler to the request pipeline.
|
|
||||||
app.UseIISPlatformHandler();
|
|
||||||
|
|
||||||
// Add the following to the request pipeline only in development environment.
|
|
||||||
if (env.IsDevelopment())
|
|
||||||
{
|
|
||||||
app.UseDeveloperExceptionPage();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Add Error handling middleware which catches all application specific errors and
|
|
||||||
// send the request to the following path or controller action.
|
|
||||||
app.UseExceptionHandler("/Home/Error");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dynamically transpile any .js files under the '/js/' directory
|
// Dynamically transpile any .js files under the '/js/' directory
|
||||||
app.Use(next => async context => {
|
app.Use(next => async context => {
|
||||||
@@ -73,17 +40,27 @@ namespace ES2015Example
|
|||||||
await next.Invoke(context);
|
await next.Invoke(context);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add static files to the request pipeline.
|
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
|
loggerFactory.AddConsole();
|
||||||
// Add MVC to the request pipeline.
|
|
||||||
app.UseMvc(routes =>
|
app.UseMvc(routes =>
|
||||||
{
|
{
|
||||||
routes.MapRoute(
|
routes.MapRoute(
|
||||||
name: "default",
|
name: "default",
|
||||||
template: "{controller}/{action?}/{id?}",
|
template: "{controller=Home}/{action=Index}/{id?}");
|
||||||
defaults: new { controller="Home", action = "Index" });
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void Main(string[] args)
|
||||||
|
{
|
||||||
|
var host = new WebHostBuilder()
|
||||||
|
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||||
|
.UseDefaultHostingConfiguration(args)
|
||||||
|
.UseIISPlatformHandlerUrl()
|
||||||
|
.UseKestrel()
|
||||||
|
.UseStartup<Startup>()
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
host.Run();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
@using ES2015Example
|
@using ES2015Example
|
||||||
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
|
@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"
|
||||||
|
|||||||
@@ -4,24 +4,35 @@
|
|||||||
"tooling": {
|
"tooling": {
|
||||||
"defaultNamespace": "ES2015Example"
|
"defaultNamespace": "ES2015Example"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"compilationOptions": {
|
||||||
"Microsoft.AspNet.Diagnostics": "1.0.0-rc1-*",
|
"emitEntryPoint": true,
|
||||||
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-*",
|
"warningsAsErrors": true,
|
||||||
"Microsoft.AspNet.Mvc": "6.0.0-rc1-*",
|
"preserveCompilationContext": true
|
||||||
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-*",
|
|
||||||
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-*",
|
|
||||||
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-*",
|
|
||||||
"Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-*",
|
|
||||||
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-*",
|
|
||||||
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-*",
|
|
||||||
"Microsoft.AspNet.NodeServices": "1.0.0-*"
|
|
||||||
},
|
},
|
||||||
"commands": {
|
"dependencies": {
|
||||||
"web": "Microsoft.AspNet.Server.Kestrel"
|
"Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
|
||||||
|
"Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*",
|
||||||
|
"Microsoft.AspNetCore.Mvc": "1.0.0-*",
|
||||||
|
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*",
|
||||||
|
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
|
||||||
|
"Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
|
||||||
|
"Microsoft.Extensions.Configuration.Json": "1.0.0-*",
|
||||||
|
"Microsoft.Extensions.Logging.Console": "1.0.0-*",
|
||||||
|
"Microsoft.NETCore.Platforms": "1.0.1-*",
|
||||||
|
"Microsoft.Extensions.Logging.Debug": "1.0.0-*",
|
||||||
|
"Microsoft.AspNet.NodeServices": "1.0.0-*"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"dnx451": {},
|
"dnx451": {},
|
||||||
"dnxcore50": {}
|
"netstandardapp1.5": {
|
||||||
|
"imports": [
|
||||||
|
"dnxcore50",
|
||||||
|
"portable-net451+win8"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"NETStandard.Library": "1.5.0-*"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"wwwroot",
|
"wwwroot",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace Webpack.Controllers
|
namespace Webpack.Controllers
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,52 +1,25 @@
|
|||||||
using System;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using System.Collections.Generic;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using System.Linq;
|
using Microsoft.AspNetCore.Http;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNet.Builder;
|
|
||||||
using Microsoft.AspNet.Hosting;
|
|
||||||
using Microsoft.AspNet.SpaServices.Webpack;
|
using Microsoft.AspNet.SpaServices.Webpack;
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace Webpack
|
namespace Webpack
|
||||||
{
|
{
|
||||||
public class Startup
|
public class Startup
|
||||||
{
|
{
|
||||||
public Startup(IHostingEnvironment env)
|
|
||||||
{
|
|
||||||
// Set up configuration sources.
|
|
||||||
var builder = new ConfigurationBuilder()
|
|
||||||
.AddJsonFile("appsettings.json")
|
|
||||||
.AddEnvironmentVariables();
|
|
||||||
Configuration = builder.Build();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IConfigurationRoot Configuration { get; set; }
|
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to add services to the container.
|
// This method gets called by the runtime. Use this method to add services to the container.
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
// Add framework services.
|
|
||||||
services.AddMvc();
|
services.AddMvc();
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
|
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHostingEnvironment env)
|
||||||
{
|
{
|
||||||
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
|
app.UseDeveloperExceptionPage();
|
||||||
loggerFactory.AddDebug();
|
|
||||||
|
|
||||||
if (env.IsDevelopment())
|
|
||||||
{
|
|
||||||
app.UseDeveloperExceptionPage();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
app.UseExceptionHandler("/Home/Error");
|
|
||||||
}
|
|
||||||
|
|
||||||
app.UseIISPlatformHandler();
|
|
||||||
|
|
||||||
if (env.IsDevelopment()) {
|
if (env.IsDevelopment()) {
|
||||||
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions {
|
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions {
|
||||||
@@ -55,7 +28,7 @@ namespace Webpack
|
|||||||
}
|
}
|
||||||
|
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
|
loggerFactory.AddConsole();
|
||||||
app.UseMvc(routes =>
|
app.UseMvc(routes =>
|
||||||
{
|
{
|
||||||
routes.MapRoute(
|
routes.MapRoute(
|
||||||
@@ -64,7 +37,17 @@ namespace Webpack
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Entry point for the application.
|
public static void Main(string[] args)
|
||||||
public static void Main(string[] args) => Microsoft.AspNet.Hosting.WebApplication.Run<Startup>(args);
|
{
|
||||||
|
var host = new WebHostBuilder()
|
||||||
|
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||||
|
.UseDefaultHostingConfiguration(args)
|
||||||
|
.UseIISPlatformHandlerUrl()
|
||||||
|
.UseKestrel()
|
||||||
|
.UseStartup<Startup>()
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
host.Run();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
@using Webpack
|
@using Webpack
|
||||||
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
|
@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
{
|
{
|
||||||
"version": "1.0.0-*",
|
"version": "1.0.0-*",
|
||||||
"compilationOptions": {
|
"compilationOptions": {
|
||||||
"emitEntryPoint": true
|
"emitEntryPoint": true,
|
||||||
|
"warningsAsErrors": true,
|
||||||
|
"preserveCompilationContext": true
|
||||||
},
|
},
|
||||||
"tooling": {
|
"tooling": {
|
||||||
"defaultNamespace": "Webpack"
|
"defaultNamespace": "Webpack"
|
||||||
},
|
},
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final",
|
"Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
|
||||||
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
|
"Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*",
|
||||||
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
|
"Microsoft.AspNetCore.Mvc": "1.0.0-*",
|
||||||
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
|
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*",
|
||||||
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
|
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
|
||||||
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
|
"Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
|
||||||
"Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
|
"Microsoft.Extensions.Configuration.Json": "1.0.0-*",
|
||||||
"Microsoft.Extensions.Configuration.FileProviderExtensions" : "1.0.0-rc1-final",
|
"Microsoft.Extensions.Logging.Console": "1.0.0-*",
|
||||||
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
|
"Microsoft.NETCore.Platforms": "1.0.1-*",
|
||||||
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
|
"Microsoft.Extensions.Logging.Debug": "1.0.0-*",
|
||||||
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
|
|
||||||
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
|
|
||||||
"Microsoft.AspNet.SpaServices": "1.0.0-*"
|
"Microsoft.AspNet.SpaServices": "1.0.0-*"
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -29,7 +29,15 @@
|
|||||||
|
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"dnx451": {},
|
"dnx451": {},
|
||||||
"dnxcore50": {}
|
"netstandardapp1.5": {
|
||||||
|
"imports": [
|
||||||
|
"dnxcore50",
|
||||||
|
"portable-net451+win8"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"NETStandard.Library": "1.5.0-*"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"exclude": [
|
"exclude": [
|
||||||
@@ -46,10 +54,7 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepublish": [
|
"prepublish": [
|
||||||
"npm install",
|
"npm install"
|
||||||
"bower install",
|
|
||||||
"gulp clean",
|
|
||||||
"gulp min"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System;
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Mvc.Rendering;
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ namespace Microsoft.AspNet.AngularServices {
|
|||||||
var responseBody = await response.Content.ReadAsStringAsync();
|
var responseBody = await response.Content.ReadAsStringAsync();
|
||||||
return new HtmlString(FormatAsScript(url, response.StatusCode, responseBody));
|
return new HtmlString(FormatAsScript(url, response.StatusCode, responseBody));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
var logger = (ILogger)html.ViewContext.HttpContext.ApplicationServices.GetService(typeof (ILogger));
|
var logger = (ILogger)html.ViewContext.HttpContext.RequestServices.GetService(typeof (ILogger));
|
||||||
if (logger != null) {
|
if (logger != null) {
|
||||||
logger.LogWarning("Error priming cache for URL: " + url, ex);
|
logger.LogWarning("Error priming cache for URL: " + url, ex);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,21 +13,19 @@
|
|||||||
"defaultNamespace": "Microsoft.AspNet.AngularServices"
|
"defaultNamespace": "Microsoft.AspNet.AngularServices"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net451": { },
|
"dnx451": {},
|
||||||
"dotnet5.4": {
|
"netstandard1.5": {
|
||||||
|
"imports": [
|
||||||
|
"dotnet5.6",
|
||||||
|
"portable-net451+win8"
|
||||||
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.CSharp": "4.0.1-beta-*",
|
|
||||||
"System.Collections": "4.0.11-beta-*",
|
|
||||||
"System.Linq": "4.0.1-beta-*",
|
|
||||||
"System.Net.Http": "4.0.1-beta-*",
|
|
||||||
"System.Runtime": "4.0.21-beta-*",
|
|
||||||
"System.Threading": "4.0.11-beta-*"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
|
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*",
|
||||||
"Microsoft.AspNet.NodeServices": "1.0.0-alpha7",
|
"Microsoft.AspNet.NodeServices": "1.0.0-*",
|
||||||
"Microsoft.AspNet.SpaServices": "1.0.0-alpha7-1"
|
"Microsoft.AspNet.SpaServices": "1.0.0-*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.PlatformAbstractions;
|
using Microsoft.Extensions.PlatformAbstractions;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.NodeServices {
|
namespace Microsoft.AspNet.NodeServices {
|
||||||
public static class Configuration {
|
public static class Configuration {
|
||||||
@@ -15,9 +16,9 @@ namespace Microsoft.AspNet.NodeServices {
|
|||||||
|
|
||||||
public static void AddNodeServices(this IServiceCollection serviceCollection, NodeServicesOptions options) {
|
public static void AddNodeServices(this IServiceCollection serviceCollection, NodeServicesOptions options) {
|
||||||
serviceCollection.AddSingleton(typeof(INodeServices), (serviceProvider) => {
|
serviceCollection.AddSingleton(typeof(INodeServices), (serviceProvider) => {
|
||||||
var appEnv = serviceProvider.GetRequiredService<IApplicationEnvironment>();
|
var hostEnv = serviceProvider.GetRequiredService<IHostingEnvironment>();
|
||||||
if (string.IsNullOrEmpty(options.ProjectPath)) {
|
if (string.IsNullOrEmpty(options.ProjectPath)) {
|
||||||
options.ProjectPath = appEnv.ApplicationBasePath;
|
options.ProjectPath = hostEnv.ContentRootPath;
|
||||||
}
|
}
|
||||||
return CreateNodeServices(options);
|
return CreateNodeServices(options);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,23 +10,24 @@
|
|||||||
"url": "git://github.com/aspnet/nodeservices"
|
"url": "git://github.com/aspnet/nodeservices"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-rc1-final",
|
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-*",
|
||||||
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc1-final",
|
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-*",
|
||||||
"Newtonsoft.Json": "8.0.1-beta3",
|
"Microsoft.AspNetCore.Hosting.Abstractions": "1.0.0-*",
|
||||||
|
"Newtonsoft.Json": "8.0.3",
|
||||||
"System.Net.Http": "4.0.1-beta-*"
|
"System.Net.Http": "4.0.1-beta-*"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net451": { },
|
"dnx451": {},
|
||||||
"dotnet5.4": {
|
"netstandard1.5": {
|
||||||
|
"imports": [
|
||||||
|
"dotnet5.6",
|
||||||
|
"portable-net451+win8"
|
||||||
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.CSharp": "4.0.1-beta-*",
|
"System.Text.Encoding": "4.0.11-*",
|
||||||
"System.Collections": "4.0.11-beta-*",
|
"System.Text.RegularExpressions": "4.0.10",
|
||||||
"System.Console": "4.0.0-beta-*",
|
|
||||||
"System.Diagnostics.Process": "4.1.0-beta-*",
|
"System.Diagnostics.Process": "4.1.0-beta-*",
|
||||||
"System.IO.FileSystem": "4.0.1-beta-*",
|
"System.Console": "4.0.0-beta-*"
|
||||||
"System.Linq": "4.0.1-beta-*",
|
|
||||||
"System.Text.RegularExpressions": "4.0.11-beta-*",
|
|
||||||
"System.Threading": "4.0.11-beta-*"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,19 +13,18 @@
|
|||||||
"defaultNamespace": "Microsoft.AspNet.ReactServices"
|
"defaultNamespace": "Microsoft.AspNet.ReactServices"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
|
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*",
|
||||||
"Microsoft.AspNet.NodeServices": "1.0.0-alpha7",
|
"Microsoft.AspNet.NodeServices": "1.0.0-*",
|
||||||
"Microsoft.AspNet.SpaServices": "1.0.0-alpha7-1"
|
"Microsoft.AspNet.SpaServices": "1.0.0-*"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net451": { },
|
"dnx451": {},
|
||||||
"dotnet5.4": {
|
"netstandard1.5": {
|
||||||
|
"imports": [
|
||||||
|
"dotnet5.6",
|
||||||
|
"portable-net451+win8"
|
||||||
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.CSharp": "4.0.1-beta-*",
|
|
||||||
"System.Collections": "4.0.11-beta-*",
|
|
||||||
"System.Linq": "4.0.1-beta-*",
|
|
||||||
"System.Runtime": "4.0.21-beta-*",
|
|
||||||
"System.Threading": "4.0.11-beta-*"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Http;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNet.Http.Extensions;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Http.Extensions;
|
||||||
|
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
||||||
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||||
using Microsoft.AspNet.NodeServices;
|
using Microsoft.AspNet.NodeServices;
|
||||||
using Microsoft.AspNet.Razor.TagHelpers;
|
using Microsoft.AspNetCore.Razor.TagHelpers;
|
||||||
using Microsoft.Extensions.PlatformAbstractions;
|
using Microsoft.Extensions.PlatformAbstractions;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
@@ -28,16 +31,18 @@ namespace Microsoft.AspNet.SpaServices.Prerendering
|
|||||||
[HtmlAttributeName(PrerenderWebpackConfigAttributeName)]
|
[HtmlAttributeName(PrerenderWebpackConfigAttributeName)]
|
||||||
public string WebpackConfigPath { get; set; }
|
public string WebpackConfigPath { get; set; }
|
||||||
|
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
|
[ViewContext]
|
||||||
|
public ViewContext ViewContext { get; set; }
|
||||||
|
|
||||||
private string applicationBasePath;
|
private string applicationBasePath;
|
||||||
private IHttpContextAccessor contextAccessor;
|
|
||||||
private INodeServices nodeServices;
|
private INodeServices nodeServices;
|
||||||
|
|
||||||
public PrerenderTagHelper(IServiceProvider serviceProvider, IHttpContextAccessor contextAccessor)
|
public PrerenderTagHelper(IServiceProvider serviceProvider)
|
||||||
{
|
{
|
||||||
var appEnv = (IApplicationEnvironment)serviceProvider.GetService(typeof(IApplicationEnvironment));
|
var hostEnv = (IHostingEnvironment)serviceProvider.GetService(typeof (IHostingEnvironment));
|
||||||
this.contextAccessor = contextAccessor;
|
|
||||||
this.nodeServices = (INodeServices)serviceProvider.GetService(typeof (INodeServices)) ?? fallbackNodeServices;
|
this.nodeServices = (INodeServices)serviceProvider.GetService(typeof (INodeServices)) ?? fallbackNodeServices;
|
||||||
this.applicationBasePath = appEnv.ApplicationBasePath;
|
this.applicationBasePath = hostEnv.ContentRootPath;
|
||||||
|
|
||||||
// Consider removing the following. Having it means you can get away with not putting app.AddNodeServices()
|
// Consider removing the following. Having it means you can get away with not putting app.AddNodeServices()
|
||||||
// in your startup file, but then again it might be confusing that you don't need to.
|
// in your startup file, but then again it might be confusing that you don't need to.
|
||||||
@@ -51,7 +56,7 @@ namespace Microsoft.AspNet.SpaServices.Prerendering
|
|||||||
|
|
||||||
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
|
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
|
||||||
{
|
{
|
||||||
var request = this.contextAccessor.HttpContext.Request;
|
var request = this.ViewContext.HttpContext.Request;
|
||||||
var result = await Prerenderer.RenderToString(
|
var result = await Prerenderer.RenderToString(
|
||||||
applicationBasePath: this.applicationBasePath,
|
applicationBasePath: this.applicationBasePath,
|
||||||
nodeServices: this.nodeServices,
|
nodeServices: this.nodeServices,
|
||||||
@@ -59,7 +64,7 @@ namespace Microsoft.AspNet.SpaServices.Prerendering
|
|||||||
exportName = this.ExportName,
|
exportName = this.ExportName,
|
||||||
webpackConfig = this.WebpackConfigPath
|
webpackConfig = this.WebpackConfigPath
|
||||||
},
|
},
|
||||||
requestAbsoluteUrl: UriHelper.GetEncodedUrl(this.contextAccessor.HttpContext.Request),
|
requestAbsoluteUrl: UriHelper.GetEncodedUrl(request),
|
||||||
requestPathAndQuery: request.Path + request.QueryString.Value);
|
requestPathAndQuery: request.Path + request.QueryString.Value);
|
||||||
output.Content.SetHtmlContent(result.Html);
|
output.Content.SetHtmlContent(result.Html);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Microsoft.AspNet.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNet.Routing;
|
using Microsoft.AspNetCore.Routing;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.SpaServices
|
namespace Microsoft.AspNet.SpaServices
|
||||||
{
|
{
|
||||||
@@ -17,7 +17,7 @@ namespace Microsoft.AspNet.SpaServices
|
|||||||
this.clientRouteTokenName = clientRouteTokenName;
|
this.clientRouteTokenName = clientRouteTokenName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Match(HttpContext httpContext, IRouter route, string routeKey, IDictionary<string, object> values, RouteDirection routeDirection)
|
public bool Match(HttpContext httpContext, IRouter route, string routeKey, RouteValueDictionary values, RouteDirection routeDirection)
|
||||||
{
|
{
|
||||||
var clientRouteValue = (values[this.clientRouteTokenName] as string) ?? string.Empty;
|
var clientRouteValue = (values[this.clientRouteTokenName] as string) ?? string.Empty;
|
||||||
return !HasDotInLastSegment(clientRouteValue);
|
return !HasDotInLastSegment(clientRouteValue);
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Microsoft.AspNet.Routing;
|
using Microsoft.AspNetCore.Routing;
|
||||||
using Microsoft.AspNet.SpaServices;
|
using Microsoft.AspNet.SpaServices;
|
||||||
|
|
||||||
// Putting in this namespace so it's always available whenever MapRoute is
|
// Putting in this namespace so it's always available whenever MapRoute is
|
||||||
namespace Microsoft.AspNet.Builder
|
namespace Microsoft.AspNetCore.Builder
|
||||||
{
|
{
|
||||||
public static class SpaRouteExtensions
|
public static class SpaRouteExtensions
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ using System.Linq;
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNet.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.SpaServices.Webpack
|
namespace Microsoft.AspNet.SpaServices.Webpack
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,11 +3,13 @@ using System.IO;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.NodeServices;
|
using Microsoft.AspNet.NodeServices;
|
||||||
using Microsoft.AspNet.SpaServices.Webpack;
|
using Microsoft.AspNet.SpaServices.Webpack;
|
||||||
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.Extensions.PlatformAbstractions;
|
using Microsoft.Extensions.PlatformAbstractions;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
// Putting in this namespace so it's always available whenever MapRoute is
|
// Putting in this namespace so it's always available whenever MapRoute is
|
||||||
namespace Microsoft.AspNet.Builder
|
namespace Microsoft.AspNetCore.Builder
|
||||||
{
|
{
|
||||||
public static class WebpackDevMiddleware
|
public static class WebpackDevMiddleware
|
||||||
{
|
{
|
||||||
@@ -30,10 +32,10 @@ namespace Microsoft.AspNet.Builder
|
|||||||
// because it must *not* restart when files change (if it did, you'd lose all the benefits of Webpack
|
// 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
|
// 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.
|
// as fast as some theoretical future alternative.
|
||||||
var appEnv = (IApplicationEnvironment)appBuilder.ApplicationServices.GetService(typeof(IApplicationEnvironment));
|
var hostEnv = (IHostingEnvironment)appBuilder.ApplicationServices.GetService(typeof (IHostingEnvironment));
|
||||||
var nodeServices = Configuration.CreateNodeServices(new NodeServicesOptions {
|
var nodeServices = Configuration.CreateNodeServices(new NodeServicesOptions {
|
||||||
HostingModel = NodeHostingModel.Http,
|
HostingModel = NodeHostingModel.Http,
|
||||||
ProjectPath = appEnv.ApplicationBasePath,
|
ProjectPath = hostEnv.ContentRootPath,
|
||||||
WatchFileExtensions = new string[] {} // Don't watch anything
|
WatchFileExtensions = new string[] {} // Don't watch anything
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -43,7 +45,7 @@ namespace Microsoft.AspNet.Builder
|
|||||||
|
|
||||||
// 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 {
|
||||||
webpackConfigPath = Path.Combine(appEnv.ApplicationBasePath, options.ConfigFile ?? DefaultConfigFile),
|
webpackConfigPath = Path.Combine(hostEnv.ContentRootPath, options.ConfigFile ?? DefaultConfigFile),
|
||||||
suppliedOptions = options
|
suppliedOptions = options
|
||||||
};
|
};
|
||||||
var devServerInfo = nodeServices.InvokeExport<WebpackDevServerInfo>(nodeScript.FileName, "createWebpackDevServer", JsonConvert.SerializeObject(devServerOptions)).Result;
|
var devServerInfo = nodeServices.InvokeExport<WebpackDevServerInfo>(nodeScript.FileName, "createWebpackDevServer", JsonConvert.SerializeObject(devServerOptions)).Result;
|
||||||
|
|||||||
@@ -13,13 +13,17 @@
|
|||||||
"projectUrl": "",
|
"projectUrl": "",
|
||||||
"licenseUrl": "",
|
"licenseUrl": "",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
|
"Microsoft.AspNetCore.Mvc": "1.0.0-*",
|
||||||
"Microsoft.AspNet.Routing": "1.0.0-rc1-final",
|
"Microsoft.AspNetCore.Routing": "1.0.0-*",
|
||||||
"Microsoft.AspNet.NodeServices": "1.0.0-alpha7"
|
"Microsoft.AspNet.NodeServices": "1.0.0-*"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net451": { },
|
"dnx451": {},
|
||||||
"dotnet5.4": {
|
"netstandard1.5": {
|
||||||
|
"imports": [
|
||||||
|
"dotnet5.6",
|
||||||
|
"portable-net451+win8"
|
||||||
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace WebApplicationBasic.Controllers
|
namespace WebApplicationBasic.Controllers
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace WebApplicationBasic.Controllers
|
namespace WebApplicationBasic.Controllers
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNet.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNet.SpaServices.Webpack;
|
using Microsoft.AspNet.SpaServices.Webpack;
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Newtonsoft.Json.Serialization;
|
using Newtonsoft.Json.Serialization;
|
||||||
@@ -14,54 +15,25 @@ namespace WebApplicationBasic
|
|||||||
{
|
{
|
||||||
public class Startup
|
public class Startup
|
||||||
{
|
{
|
||||||
public Startup(IHostingEnvironment env)
|
|
||||||
{
|
|
||||||
// Set up configuration sources.
|
|
||||||
var builder = new ConfigurationBuilder()
|
|
||||||
.AddJsonFile("appsettings.json")
|
|
||||||
.AddEnvironmentVariables();
|
|
||||||
Configuration = builder.Build();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IConfigurationRoot Configuration { get; set; }
|
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to add services to the container.
|
// This method gets called by the runtime. Use this method to add services to the container.
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
// Add framework services.
|
services.AddMvc();
|
||||||
services.AddMvc().AddJsonOptions(options =>
|
|
||||||
{
|
|
||||||
options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
|
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHostingEnvironment env)
|
||||||
{
|
{
|
||||||
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
|
app.UseDeveloperExceptionPage();
|
||||||
loggerFactory.AddDebug();
|
|
||||||
|
|
||||||
if (env.IsDevelopment())
|
if (env.IsDevelopment()) {
|
||||||
{
|
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions {
|
||||||
app.UseDeveloperExceptionPage();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
app.UseExceptionHandler("/Home/Error");
|
|
||||||
}
|
|
||||||
|
|
||||||
app.UseIISPlatformHandler();
|
|
||||||
|
|
||||||
if (env.IsDevelopment())
|
|
||||||
{
|
|
||||||
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
|
|
||||||
{
|
|
||||||
HotModuleReplacement = true
|
HotModuleReplacement = true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
|
loggerFactory.AddConsole();
|
||||||
app.UseMvc(routes =>
|
app.UseMvc(routes =>
|
||||||
{
|
{
|
||||||
routes.MapRoute(
|
routes.MapRoute(
|
||||||
@@ -74,7 +46,17 @@ namespace WebApplicationBasic
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Entry point for the application.
|
public static void Main(string[] args)
|
||||||
public static void Main(string[] args) => Microsoft.AspNet.Hosting.WebApplication.Run<Startup>(args);
|
{
|
||||||
|
var host = new WebHostBuilder()
|
||||||
|
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||||
|
.UseDefaultHostingConfiguration(args)
|
||||||
|
.UseIISPlatformHandlerUrl()
|
||||||
|
.UseKestrel()
|
||||||
|
.UseStartup<Startup>()
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
host.Run();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
@using WebApplicationBasic
|
@using WebApplicationBasic
|
||||||
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
|
@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"
|
||||||
@addTagHelper "*, Microsoft.AspNet.SpaServices"
|
@addTagHelper "*, Microsoft.AspNet.SpaServices"
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
{
|
{
|
||||||
"version": "1.0.0-*",
|
"version": "1.0.0-*",
|
||||||
"compilationOptions": {
|
"compilationOptions": {
|
||||||
"emitEntryPoint": true
|
"emitEntryPoint": true,
|
||||||
|
"warningsAsErrors": true,
|
||||||
|
"preserveCompilationContext": true
|
||||||
},
|
},
|
||||||
"tooling": {
|
"tooling": {
|
||||||
"defaultNamespace": "WebApplicationBasic"
|
"defaultNamespace": "WebApplicationBasic"
|
||||||
},
|
},
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final",
|
"Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
|
||||||
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
|
"Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*",
|
||||||
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
|
"Microsoft.AspNetCore.Mvc": "1.0.0-*",
|
||||||
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
|
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*",
|
||||||
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
|
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
|
||||||
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
|
"Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
|
||||||
"Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
|
"Microsoft.Extensions.Configuration.Json": "1.0.0-*",
|
||||||
"Microsoft.Extensions.Configuration.FileProviderExtensions" : "1.0.0-rc1-final",
|
"Microsoft.Extensions.Logging.Console": "1.0.0-*",
|
||||||
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
|
"Microsoft.NETCore.Platforms": "1.0.1-*",
|
||||||
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
|
"Microsoft.Extensions.Logging.Debug": "1.0.0-*",
|
||||||
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
|
|
||||||
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
|
|
||||||
"Microsoft.AspNet.AngularServices": "1.0.0-*"
|
"Microsoft.AspNet.AngularServices": "1.0.0-*"
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -29,7 +29,15 @@
|
|||||||
|
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"dnx451": {},
|
"dnx451": {},
|
||||||
"dnxcore50": {}
|
"netstandardapp1.5": {
|
||||||
|
"imports": [
|
||||||
|
"dnxcore50",
|
||||||
|
"portable-net451+win8"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"NETStandard.Library": "1.5.0-*"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"exclude": [
|
"exclude": [
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ module.exports = {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
entry: {
|
entry: {
|
||||||
vendor: ['angular2/bundles/angular2-polyfills.js', 'bootstrap', 'bootstrap/dist/css/bootstrap.css', 'style-loader', 'jquery', 'angular2/core', 'angular2/common', 'angular2/http', 'angular2/router', 'angular2/platform/browser']
|
vendor: ['angular2-universal-polyfills', 'bootstrap', 'bootstrap/dist/css/bootstrap.css', 'style-loader', 'jquery', 'angular2/core', 'angular2/common', 'angular2/http', 'angular2/router', 'angular2/platform/browser']
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: path.join(__dirname, 'wwwroot', 'dist'),
|
path: path.join(__dirname, 'wwwroot', 'dist'),
|
||||||
|
|||||||
Reference in New Issue
Block a user