Sync remaining Angular-CSharp changes from OOB release into dev branch
This commit is contained in:
parent
0d9f17211f
commit
22da82ff8a
|
|
@ -6,6 +6,7 @@
|
|||
"apps": [
|
||||
{
|
||||
"root": "src",
|
||||
"outDir": "dist",
|
||||
"assets": [
|
||||
"assets"
|
||||
],
|
||||
|
|
@ -26,24 +27,6 @@
|
|||
"dev": "environments/environment.ts",
|
||||
"prod": "environments/environment.prod.ts"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ssr",
|
||||
"root": "src",
|
||||
"outDir": "dist-server",
|
||||
"assets": [
|
||||
"assets"
|
||||
],
|
||||
"main": "main.server.ts",
|
||||
"tsconfig": "tsconfig.app-ssr.json",
|
||||
"prefix": "app",
|
||||
"scripts": [],
|
||||
"environmentSource": "environments/environment.ts",
|
||||
"environments": {
|
||||
"dev": "environments/environment.ts",
|
||||
"prod": "environments/environment.prod.ts"
|
||||
},
|
||||
"platform": "server"
|
||||
}
|
||||
],
|
||||
"e2e": {
|
||||
|
|
@ -72,6 +55,9 @@
|
|||
},
|
||||
"defaults": {
|
||||
"styleExt": "css",
|
||||
"component": {}
|
||||
"component": {},
|
||||
"build": {
|
||||
"progress": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { ServerModule } from '@angular/platform-server';
|
||||
import { ModuleMapLoaderModule } from '@nguniversal/module-map-ngfactory-loader';
|
||||
import { AppComponent } from './app.component';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [AppModule, ServerModule, ModuleMapLoaderModule],
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
export class AppServerModule { }
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
import 'zone.js/dist/zone-node';
|
||||
import 'reflect-metadata';
|
||||
import { renderModule, renderModuleFactory } from '@angular/platform-server';
|
||||
import { APP_BASE_HREF } from '@angular/common';
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { provideModuleMap } from '@nguniversal/module-map-ngfactory-loader';
|
||||
import { createServerRenderer } from 'aspnet-prerendering';
|
||||
export { AppServerModule } from './app/app.server.module';
|
||||
const { AppServerModule, AppServerModuleNgFactory, LAZY_MODULE_MAP } = (module as any).exports;
|
||||
|
||||
enableProdMode();
|
||||
|
||||
export default createServerRenderer(params => {
|
||||
const options = {
|
||||
document: params.data.originalHtml,
|
||||
url: params.url,
|
||||
extraProviders: [
|
||||
provideModuleMap(LAZY_MODULE_MAP),
|
||||
{ provide: APP_BASE_HREF, useValue: params.baseUrl },
|
||||
{ provide: 'BASE_URL', useValue: params.origin + params.baseUrl }
|
||||
]
|
||||
};
|
||||
|
||||
const renderPromise = AppServerModuleNgFactory
|
||||
? /* AoT */ renderModuleFactory(AppServerModuleNgFactory, options)
|
||||
: /* dev */ renderModule(AppServerModule, options);
|
||||
|
||||
return renderPromise.then(html => ({ html }));
|
||||
});
|
||||
|
|
@ -55,7 +55,7 @@ import 'core-js/es7/reflect';
|
|||
|
||||
|
||||
/***************************************************************************************************
|
||||
* Zone JS is required by Angular itself.
|
||||
* Zone JS is required by default for Angular itself.
|
||||
*/
|
||||
import 'zone.js/dist/zone'; // Included with Angular CLI.
|
||||
|
||||
|
|
@ -64,13 +64,3 @@ import 'zone.js/dist/zone'; // Included with Angular CLI.
|
|||
/***************************************************************************************************
|
||||
* APPLICATION IMPORTS
|
||||
*/
|
||||
|
||||
/**
|
||||
* Date, currency, decimal and percent pipes.
|
||||
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
|
||||
*/
|
||||
// import 'intl'; // Run `npm install --save intl`.
|
||||
/**
|
||||
* Need to import at least one locale-data with intl.
|
||||
*/
|
||||
// import 'intl/locale-data/jsonp/en';
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"module": "commonjs"
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"entryModule": "app/app.server.module#AppServerModule"
|
||||
}
|
||||
}
|
||||
|
|
@ -11,6 +11,9 @@
|
|||
"check-space"
|
||||
],
|
||||
"curly": true,
|
||||
"deprecation": {
|
||||
"severity": "warn"
|
||||
},
|
||||
"eofline": true,
|
||||
"forin": true,
|
||||
"import-blacklist": [
|
||||
|
|
@ -127,7 +130,6 @@
|
|||
"app",
|
||||
"kebab-case"
|
||||
],
|
||||
"angular-whitespace": [true, "check-interpolation"],
|
||||
"no-output-on-prefix": true,
|
||||
"use-input-property-decorator": true,
|
||||
"use-output-property-decorator": true,
|
||||
|
|
|
|||
|
|
@ -53,20 +53,10 @@ namespace AngularSpa
|
|||
|
||||
app.UseSpa(spa =>
|
||||
{
|
||||
spa.Options.SourcePath = "ClientApp";
|
||||
// To learn more about options for serving an Angular SPA from ASP.NET Core,
|
||||
// see https://go.microsoft.com/fwlink/?linkid=864501
|
||||
|
||||
/*
|
||||
// If you want to enable server-side rendering (SSR),
|
||||
// [1] In AngularSpa.csproj, change the <BuildServerSideRenderer> property
|
||||
// value to 'true', so that the SSR bundle is built during publish
|
||||
// [2] Uncomment this code block
|
||||
spa.UseSpaPrerendering(options =>
|
||||
{
|
||||
options.BootModulePath = $"{spa.Options.SourcePath}/dist-server/main.bundle.js";
|
||||
options.BootModuleBuilder = env.IsDevelopment() ? new AngularCliBuilder(npmScript: "build:ssr") : null;
|
||||
options.ExcludeUrls = new[] { "/sockjs-node" };
|
||||
});
|
||||
*/
|
||||
spa.Options.SourcePath = "ClientApp";
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue