简体   繁体   English

为什么 Firebase Deploy 刚刚找到 1-2 文件? 只是 Firebase 托管的默认索引

[英]Why Firebase Deploy just found 1-2 file? Just default index of Firebase hosting

I'm setting up to deploy my Angular App to Firebase Hosting.我正在设置将我的 Angular 应用程序部署到 Firebase 托管。 But it just makes a default firebase index hosting, nothing change.但它只是做了一个默认的 firebase 索引托管,没有任何改变。

I had use firebase init and my dist dir public, ng build --prod to make app dist dir after that use firebase deploy.我曾使用 firebase init 和我的 dist dir public, ng build --prod 来制作 app dist dir 之后使用 firebase 部署。

ng build --prod make only a dist folder with all file. ng build --prod只创建一个包含所有文件的 dist 文件夹。 It does not contain any subfolder.它不包含任何子文件夹。

Firebase said that: I must add Firebase SDK, but I don't know where to add. Firebase 说:我必须添加 Firebase SDK,但我不知道在哪里添加。

kaonashichan:toh noface$ firebase init

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

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

  /Users/noface

Before we get started, keep in mind:

  * You are initializing in an existing Firebase project directory

? Which Firebase CLI features do you want to set up for this folder? Press Space to select features, then Enter to confirm your choices. Hosting: Conf
igure 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? dist
? Configure as a single-page app (rewrite all urls to /index.html)? Yes
? File dist/index.html already exists. Overwrite? No
i  Skipping write of dist/index.html

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

✔  Firebase initialization complete!
kaonashichan:toh noface$ ng build --prod

Date: 2019-05-13T04:13:50.154Z
Hash: bbc9e5b91e532fbd9570
Time: 31202ms
chunk {0} runtime.ec2944dd8b20ec099bf3.js (runtime) 1.41 kB [entry] [rendered]
chunk {1} main.c10271b9fdcd6058774f.js (main) 376 kB [initial] [rendered]
chunk {2} polyfills.f03d03a35f15175f61b1.js (polyfills) 66.4 kB [initial] [rendered]
chunk {3} styles.167b12e8ea2d1f694d59.css (styles) 765 bytes [initial] [rendered]
kaonashichan:toh noface$ firebase deploy
kaonashichan:toh noface$ firebase deploy

=== Deploying to 'autochessmo'...

i  deploying hosting
i  hosting[autochessmo]: beginning deploy...
i  hosting[autochessmo]: found 2 files in dist
✔  hosting[autochessmo]: file upload complete
i  hosting[autochessmo]: finalizing version...
✔  hosting[autochessmo]: version finalized
i  hosting[autochessmo]: releasing new version...
✔  hosting[autochessmo]: release complete

✔  Deploy complete!

I had solved my problem. 我已经解决了我的问题。 Don't know why firebase makes firebase.json file at user/name folder instead of my project folder. 不知道为什么firebase在用户/名称文件夹而不是我的项目文件夹中创建firebase.json文件。 I just delete it and everything goes right! 我只是删除它,一切正常!

it create a folder in user with your folder name.它使用您的文件夹名称在用户中创建一个文件夹。 Which include just index and 404.html file.其中仅包括索引和 404.html 文件。

So, after initialization (firebase init) find the folder in user folder and replace all file and then deploy因此,在初始化(firebase init)之后,在用户文件夹中找到文件夹并替换所有文件,然后部署

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM