Skip to content

Commit 82b6427

Browse files
committed
fixed site ssr build
1 parent 6a0c603 commit 82b6427

9 files changed

Lines changed: 18 additions & 15 deletions

File tree

site/angular.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
},
3131
"@schematics/angular:service": {
3232
"spec": false
33+
},
34+
"@schematics/angular:application": {
35+
"strict": false
3336
}
3437
},
3538
"architect": {
@@ -62,7 +65,6 @@
6265
"optimization": true,
6366
"outputHashing": "all",
6467
"sourceMap": false,
65-
"extractCss": true,
6668
"namedChunks": false,
6769
"aot": true,
6870
"extractLicenses": true,
@@ -81,8 +83,7 @@
8183
"serve": {
8284
"builder": "@angular-devkit/build-angular:dev-server",
8385
"options": {
84-
"browserTarget": "eqmac-site:build",
85-
"port": 4300
86+
"browserTarget": "eqmac-site:build"
8687
},
8788
"configurations": {
8889
"production": {

site/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
"name": "eqmac-site",
33
"version": "0.0.0",
44
"scripts": {
5-
"start": "./node_modules/.bin/ng serve",
6-
"build": "./node_modules/.bin/ng build",
5+
"start": "ng run eqmac-site:serve-ssr",
6+
"build": "ng build --prod && ng run eqmac-site:server:production",
77
"deploy": "export $(tr -d '\\r' < .env | xargs) && ./scripts/deploy.sh",
8-
"dev:ssr": "ng run eqmac-site:serve-ssr",
9-
"serve:ssr": "node dist/server/main.js",
10-
"build:ssr": "ng build --prod && ng run eqmac-site:server:production",
8+
"serve": "node dist/server/main.js",
119
"prerender": "ng run eqmac-site:prerender"
1210
},
1311
"private": true,

site/src/app/routes/root/home/home.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export class HomeComponent {
1313
return elem.scrollIntoView({ behavior: 'smooth' })
1414
}
1515

16-
async download (urlPresent) {
17-
if (urlPresent) return
16+
async download (urlPressed: boolean) {
17+
if (urlPressed) return
1818
const url = await this.github.getLatestDownloadUrl()
1919
const link = document.createElement('a')
2020
link.download = 'eqmac.dmg'

site/src/app/routes/root/home/sections/overview/overview.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { GithubService } from 'src/app/services/github.service'
99
export class OverviewComponent implements OnInit {
1010
@Output() downloadPressed = new EventEmitter()
1111
@Output() takeATourPressed = new EventEmitter()
12-
url: string
12+
url?: string
1313
constructor (private github: GithubService) {}
1414

1515
ngOnInit () {

site/src/app/routes/root/root.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class RootComponent implements OnInit {
1212

1313
scrollTo (id: string) {
1414
const elem = document.getElementById(id)
15-
elem.scrollIntoView({ behavior: 'smooth' })
15+
elem?.scrollIntoView({ behavior: 'smooth' })
1616
}
1717

1818

site/src/app/services/github.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class GithubService {
1212
async getLatestDownloadUrl () {
1313
const release = await this.getLatestRelease()
1414
const { assets } = release
15-
const binary = assets.find(a => a.name.includes('.pkg'))
15+
const binary = assets.find((a: any) => a.name.includes('.pkg'))
1616
const downloadUrl = binary.browser_download_url
1717
return downloadUrl
1818
}

site/src/app/site.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ const routes: Routes = [{
5353
imports: [
5454
BrowserModule.withServerTransition({ appId: 'serverApp' }),
5555
FlexLayoutModule,
56-
FlexLayoutServerModule,
5756
RouterModule.forRoot(routes),
5857
BrowserAnimationsModule,
5958
HttpClientModule,

site/src/app/site.server.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import { ServerModule } from '@angular/platform-server'
33

44
import { SiteModule } from './site.module'
55
import { SiteComponent } from './site.component'
6+
import { FlexLayoutServerModule } from '@angular/flex-layout/server'
67

78
@NgModule({
89
imports: [
910
SiteModule,
1011
ServerModule,
12+
FlexLayoutServerModule
1113
],
1214
bootstrap: [SiteComponent],
1315
})

site/tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
"outDir": "./dist/out-tsc",
77
"sourceMap": true,
88
"declaration": false,
9-
"module": "esnext",
9+
"module": "es2020",
1010
"moduleResolution": "node",
1111
"emitDecoratorMetadata": true,
1212
"experimentalDecorators": true,
1313
"importHelpers": true,
1414
"target": "es2015",
15+
"resolveJsonModule": true,
16+
"skipLibCheck": true,
17+
"strict": true,
1518
"typeRoots": [
1619
"node_modules/@types"
1720
],

0 commit comments

Comments
 (0)