@@ -16,6 +16,12 @@ The app will automatically reload if you change any of the source files.
1616
1717The build artifacts will be stored in the ` dist/ ` directory.
1818
19+ ## Deploy
20+
21+ 1 . Change [ .firebaserc] ( .firebaserc ) to point to your Firebase Hosting project
22+ 1 . Ensure that you are logged in to Firebase: ` npm run login `
23+ 1 . Run ` npm run deploy `
24+
1925## Key Configuration Steps
2026
21271 . Create a workspace without an app:
@@ -29,10 +35,36 @@ ng g app --style=scss --minimal=true --routing=false --skip-tests=true static-ht
29351 . Comment out ` zone.js ` import in [ polyfills.ts] ( polyfills.ts )
30361 . In [ angular.json] ( angular.json ) clear out ` "fileReplacements": [] `
31371 . Remove ` app/ ` , ` environments/ `
32- 1 . Remove most of the Angular dependencies from [ package.json] ( package.json ) 's ` dependencies `
33- other than ` @angular/core ` , ` @angular/compiler ` , and ` rxjs `
34- 1 . Remove ` codelyzer ` and ` @angular/language-service ` from [ package.json] ( package.json ) 's ` devDependencies `
38+ 1 . Remove the following Angular dependencies from [ package.json] ( package.json ) 's ` dependencies ` :
39+ - ` @angular/animations `
40+ - ` @angular/forms `
41+ 1 . Remove the following dependencies from [ package.json] ( package.json ) 's ` devDependencies ` :
42+ - ` codelyzer `
43+ - ` @angular/language-service `
35441 . Remove ` codelyzer ` from ` rulesDirectory ` and remove all of the Codelyzer rules from
3645 the workspace [ tslint.json] ( tslint.json )
37461 . Remove ` directive-selector ` and ` component-selector ` rules
3847 from your app's [ tslint.json] ( projects/static-html/tslint.json )
48+ 1 . Enable Deployment to Firebase
49+ ``` shell script
50+ ng add @angular/fire
51+ ```
52+ 1 . Update your [ firebase.json] ( firebase.json ) to work with a static site rather than a SPA
53+ ``` json
54+ "rewrites" : [
55+ {
56+ "source" : " /" ,
57+ "destination" : " /index.html"
58+ }
59+ ]
60+ ```
61+ 1 . Add a [ 404.html] ( projects/static-html/src/404.html ) and [ 404.css] ( projects/static-html/src/404.css )
62+ 1 . Update your project's assets list in [ angular.json] ( angular.json ) to include the new files
63+ ``` json
64+ "assets" : [
65+ " projects/static-html/src/favicon.ico" ,
66+ " projects/static-html/src/404.html" ,
67+ " projects/static-html/src/404.css" ,
68+ " projects/static-html/src/assets"
69+ ],
70+ ```
0 commit comments