Build and release a web app.

web app にできたので公開するためデプロイする

Firebase Hosting を使う

Minification
Building the app for release
Deploying to the web

npm と Firebase CLI がある前提

ディレクトリを web app 化した build/web に移動

$ firebase init

    ######## #### ########  ######## ########     ###     ######  ########
    ##        ##  ##     ## ##       ##     ##  ##   ##  ##       ##
    ######    ##  ########  ######   ########  #########  ######  ######
    ##        ##  ##    ##  ##       ##     ## ##     ##       ## ##
    ##       #### ##     ## ######## ########  ##     ##  ######  ########

You're about to initialize a Firebase project in this directory:

\build\web

? Are you ready to proceed? Yes
? Which Firebase CLI features do you want to set up for this folder? Press Space to select features, then Enter to confi
rm your choices. Hosting: Configure and deploy Firebase Hosting sites

=== Project Setup

First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.

? Please select an option: Use an existing project
? Select a default Firebase project for this directory:xxxxxxxxxxxxxxxxxxxx
i  Using project xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

=== Hosting Setup

Your public directory is the folder (relative to your project directory) that
will contain Hosting assets to be uploaded with firebase deploy. If you
have a build process for your assets, use your build's output directory.

? What do you want to use as your public directory?
? Configure as a single-page app (rewrite all urls to /index.html)? Yes
? File /index.html already exists. Overwrite? No
+  Wrote /index.html

i  Writing configuration info to firebase.json...
i  Writing project information to .firebaserc...
i  Writing gitignore file to .gitignore...

+  Firebase initialization complete!
$ firebase deploy
=== Deploying to 'xxxxxxxx'...

i  deploying hosting
i  hosting[xxxxxxxx]: beginning deploy...
i  hosting[xxxxxxxx]: found 13 files in
+  hosting[xxxxxxxx]: file upload complete
i  hosting[xxxxxxxx]: finalizing version...
+  hosting[xxxxxxxx]: version finalized
i  hosting[xxxxxxxx]: releasing new version...
+  hosting[xxxxxxxx]: release complete

+  Deploy complete!

Project Console: https://console.firebase.google.com/project/xxxxxxxx/overview
Hosting URL: https://xxxxxxxx.firebaseapp.com







この記事が気に入ったらサポートをしてみませんか?