npm install -g firebase-tools
Build our Angular2 website with
Angular CLI by this command.
ng build --prod
The ready-to-deploy files are in /dist
Before deployment, we should set up the Firebase options.
for setting the following options,
- What Firebase CLI features do you want to setup?
- What Firebase project fo yu want to associate as default?
Select your default project.
- What file should be used for Database Rules?
Use default file:
database.rule.json, which will be initialized with the settings in the Firebase database rules.
- What do you want to use as your publis directory?
Of course that will be "
- Configure as a single-page app (rewrite all urls to /index.html)?
Choose yes will make every route shows the url as http://XXX/index.html but not the route url in the browser.
- File dist/index.html already exists. Overwrite?
The above settings will create 3 files in your website,
.firebaserckeeps the default Firebase project name associated with our website.
Okay, everything is done, use the command to deploy.
And we will successfully deploy our website to
This is my first time participating with the IRON MAN tournament, and I really, really had a tough time for writing the consistent articles during these 30 days :)
But what cannot kill you will make you stronger!
See ya next time and may the force be with you, my friends!
I am a Star Wars biggest fan, a blogger and a father with a little cute girl names Leia :)