Skip to content

Commit f12a327

Browse files
author
Gene Connolly
committed
convert index.html to an ejs tempate, refer production env to window
1 parent e944a1e commit f12a327

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

angular.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
"build": {
1414
"builder": "@angular-devkit/build-angular:browser",
1515
"options": {
16+
"deployUrl": "<%=deployUrl%>",
17+
"baseHref": "<%=baseHref%>",
1618
"outputPath": "dist/ng-immutable-example",
17-
"index": "src/index.html",
19+
"index": "src/index.ejs",
1820
"main": "src/main.ts",
1921
"polyfills": "src/polyfills.ts",
2022
"tsConfig": "src/tsconfig.app.json",

src/environments/environment.prod.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
export const environment = {
2-
production: true
3-
};
1+
export const environment = (window as any).env;

src/index.html renamed to src/index.ejs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<title>NgImmutableExample</title>
5+
<title>NgImmutable</title>
66
<base href="/">
77

88
<meta name="viewport" content="width=device-width, initial-scale=1">
9-
<link rel="icon" type="image/x-icon" href="favicon.ico">
9+
<link rel="icon" type="image/x-icon" href="<%=deployUrl%>favicon.ico">
10+
<script>
11+
env = <%-JSON.stringify(env)%>;
12+
</script>
1013
</head>
1114
<body>
1215
<app-root></app-root>

0 commit comments

Comments
 (0)