如何在Firebase控制台上部署Ionic 4应用程序?

时间:2019-02-14 18:18:53

标签: node.js angular firebase ionic-framework npm

不能在Firebase控制台上部署我的实际离子应用程序。

我执行的步骤:-

  • 创建一个新的离子项目
  • firebase初始化 -firebase部署

但是我无法查看离子输出

还要附上CMD屏幕截图和部署屏幕 enter image description here

enter image description here

4 个答案:

答案 0 :(得分:2)

您需要构建项目。我通常会

ionic cordova build browserionic build

此命令创建一个www目录,Firebase所需的所有文件都位于该目录中。您应该验证firebase.json的public属性是否设置为该文件夹。

然后您进行“ firebase部署”

希望有帮助!

答案 1 :(得分:1)

答案 2 :(得分:0)

(Inside ionic project)
PS E:\PROJECT\Project Angular\business-card-user - Copy> ionic build
> ng run app:build

Date: 2019-02-15T11:14:09.815Z
Hash: 19b812988985c5c367ab
Time: 32819ms
.
.
.
   DONE

PS E:\PROJECT\Project Angular\business-card-user - Copy> firebase init

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

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

  E:\PROJECT\Project Angular\business-card-user - Copy

Before we get started, keep in mind:

  * You are initializing in an existing Firebase project directory

? Are you ready to proceed? Yes
? Which Firebase CLI features do you want to setup for this folder? Press Space to select features, then Enter to confirm your choices. Ho
sting: 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.

i  .firebaserc already has a default project, skipping

=== 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? www
? Configure as a single-page app (rewrite all urls to /index.html)? Yes
? File www/index.html already exists. Overwrite? No
i  Skipping write of www/index.html

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

+  Firebase initialization complete!
PS E:\PROJECT\Project Angular\business-card-user - Copy> firebase deploy

=== Deploying to 'digitalvcard-user'...

i  deploying hosting
i  hosting[digitalvcard-user]: beginning deploy...
i  hosting[digitalvcard-user]: found 1061 files in www
+  hosting[digitalvcard-user]: file upload complete
i  hosting[digitalvcard-user]: finalizing version...
+  hosting[digitalvcard-user]: version finalized
i  hosting[digitalvcard-user]: releasing new version...
+  hosting[digitalvcard-user]: release complete

+  Deploy complete!

Project Console: https://console.firebase.google.com/........
Hosting URL: https://digitalvcard-user.firebaseapp.com

enter image description here

答案 3 :(得分:-1)

您部署的是> Firebase init创建的内容 您需要从离子应用程序上传内容,因此需要运行以下命令

> ionic build

等到成功为止。

> Firebase deploy. 

希望这会有所帮助。