Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 706809d

Browse files
fix(build): fix major build and run-time errors
closes #680
1 parent c212c17 commit 706809d

File tree

12 files changed

+66
-40
lines changed

12 files changed

+66
-40
lines changed

‎ClientApp/app/app.module.server.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { PrebootModule } from 'preboot';
55
import { AppComponent } from './app.component';
66
import { AppModuleShared } from './app.module';
77

8+
import { TransferHttpCacheModule, StateTransferInitializerModule } from '@nguniversal/common';
9+
810
@NgModule({
911
bootstrap: [AppComponent],
1012
imports: [
@@ -13,12 +15,12 @@ import { AppModuleShared } from './app.module';
1315

1416
ServerModule,
1517
PrebootModule.withConfig({ appRoot: 'app-root' }),
16-
NoopAnimationsModule
18+
NoopAnimationsModule,
1719

18-
// HttpTransferCacheModule still needs fixes for 5.0
20+
TransferHttpCacheModule,// still needs fixes for 5.0
1921
// Leave this commented out for now, as it breaks Server-renders
2022
// Looking into fixes for this! - @MarkPieszak
21-
// ServerTransferStateModule // <-- broken for the time-being with ASP.NET
23+
// StateTransferInitializerModule // <-- broken for the time-being with ASP.NET
2224
]
2325
})
2426
export class AppModule {

‎ClientApp/app/containers/counter/counter.component.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
22
import { CounterComponent } from './counter.component';
33

4+
import {} from 'jasmine';
5+
46
let fixture: ComponentFixture<CounterComponent>;
57

68
describe('Counter component', () => {

‎ClientApp/boot.browser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import './polyfills/browser.polyfills';
12
import { enableProdMode } from '@angular/core';
23
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
34
import { AppModule } from './app/app.module.browser';
4-
import './polyfills/browser.polyfills';
55

66
// // Enable either Hot Module Reloading or production mode
77
if (module['hot']) {

‎ClientApp/boot.server.PRODUCTION.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
import { enableProdMode } from '@angular/core';
2-
import {
3-
createTransferScript,
4-
IEngineOptions,
5-
ngAspnetCoreEngine
6-
} from '@nguniversal/aspnetcore-engine';
7-
import { createServerRenderer } from 'aspnet-prerendering';
8-
import 'zone.js/dist/zone-node';
1+
import 'zone.js/dist/zone-node';
92
import './polyfills/server.polyfills';
3+
import { enableProdMode } from '@angular/core';
4+
import { createServerRenderer } from 'aspnet-prerendering';
105

116
// Grab the (Node) server-specific NgModule
127
const { AppModuleNgFactory } = require('./app/app.module.server.ngfactory'); // <-- ignore this - this is Production only
8+
import { ngAspnetCoreEngine, IEngineOptions, createTransferScript } from '@nguniversal/aspnetcore-engine';
139

1410
enableProdMode();
1511

‎ClientApp/boot.server.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { enableProdMode } from '@angular/core';
1+
import 'zone.js/dist/zone-node';
2+
import './polyfills/server.polyfills';
3+
4+
import { enableProdMode } from '@angular/core';
25
import { createTransferScript, IEngineOptions, ngAspnetCoreEngine } from '@nguniversal/aspnetcore-engine';
36
import { createServerRenderer } from 'aspnet-prerendering';
4-
import'zone.js/dist/zone-node';
7+
58
// Grab the (Node) server-specific NgModule
69
import { AppModule } from './app/app.module.server';
7-
import './polyfills/server.polyfills';
8-
910

1011
enableProdMode();
1112

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
// Note: * The order is IMPORTANT! *
2+
3+
import './polyfills.ts';
4+
15
import 'reflect-metadata';
26
import 'zone.js/dist/zone';
3-
import './polyfills.ts';
47

58
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.

‎ClientApp/polyfills/polyfills.ts

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
1+
// Note: * The order is IMPORTANT! *
2+
13
/***************************************************************************************************
24
* BROWSER POLYFILLS
35
*/
46

57
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
6-
import 'core-js/es6/array';
7-
import 'core-js/es6/date';
8-
import 'core-js/es6/function';
9-
import 'core-js/es6/map';
10-
import 'core-js/es6/math';
11-
import 'core-js/es6/number';
8+
import 'core-js/es6/symbol';
129
import 'core-js/es6/object';
13-
import 'core-js/es6/parse-float';
10+
import 'core-js/es6/function';
1411
import 'core-js/es6/parse-int';
15-
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
16-
// import 'classlist.js'; // Run `npm install --save classlist.js`.
17-
/** Evergreen browsers require these. **/
18-
import 'core-js/es6/reflect';
12+
import 'core-js/es6/parse-float';
13+
import 'core-js/es6/number';
14+
import 'core-js/es6/math';
15+
import 'core-js/es6/string';
16+
import 'core-js/es6/date';
17+
import 'core-js/es6/array';
1918
import 'core-js/es6/regexp';
19+
import 'core-js/es6/map';
2020
import 'core-js/es6/set';
21-
import 'core-js/es6/string';
22-
import 'core-js/es6/symbol';
23-
import 'core-js/es7/reflect';
21+
2422
/** */
2523
import 'reflect-metadata';
24+
25+
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
26+
// import 'classlist.js'; // Run `npm install --save classlist.js`.
27+
/** Evergreen browsers require these. **/
28+
import 'core-js/es6/reflect';
29+
import 'core-js/es7/reflect';

‎ClientApp/polyfills/server.polyfills.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
import'zone.js';
1+
// Note: * The order is IMPORTANT! *
22
import './polyfills.ts';
3+
4+
import 'zone.js';

‎ClientApp/tsconfig.app.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
"baseUrl": "",
77
"types": []
88
},
9-
"exclude": ["test.ts", "**/*.spec.ts", "boot.server.PRODUCTION.ts"]
9+
"exclude": [
10+
"test.ts",
11+
"**/*.spec.ts",
12+
"boot.server.PRODUCTION.ts"
13+
]
1014
}

‎Views/Home/Index.cshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
<!-- Our webpack bundle -->
1010
<script src="~/dist/main-client.js" asp-append-version="true"></script>
1111
}
12+
1213
@Html.Raw(ViewData["ServiceWorker"])

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /