Angular 为什么Firebase部署刚刚找到1-2文件?只是Firebase主机的默认索引

Angular 为什么Firebase部署刚刚找到1-2文件?只是Firebase主机的默认索引,angular,firebase,firebase-hosting,Angular,Firebase,Firebase Hosting,我正在设置将Angular应用程序部署到Firebase主机。但它只是创建了一个默认的firebase索引宿主,没有任何更改 我使用firebase init和我的dist dir public,ng build--prod在使用firebase deploy之后生成app dist dir ng build--prod仅创建包含所有文件的dist文件夹。它不包含任何子文件夹 Firebase说:我必须添加Firebase SDK,但我不知道要添加到哪里 kaonashichan:toh nof

我正在设置将Angular应用程序部署到Firebase主机。但它只是创建了一个默认的firebase索引宿主,没有任何更改

我使用firebase init和我的dist dir public,ng build--prod在使用firebase deploy之后生成app dist dir

ng build--prod
仅创建包含所有文件的dist文件夹。它不包含任何子文件夹

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!

我已经解决了我的问题。不知道为什么firebase在user/name文件夹而不是我的项目文件夹中生成firebase.json文件。我只是删除它,一切正常

运行ng build命令后,dist文件夹的内容是什么?更新版本的@angular/cli将应用程序放入dist的子文件夹中。如果是这种情况,则需要更新firebase部署配置以定位dist中的子文件夹。这是生成后的my dist dir。我使用了
npm install-g@angular/cli
命令来安装angular cli,所以我认为它是最新版本。可能重复的不知道为什么我的
ng build--prod
没有成为项目名称子文件夹,只是作为根目录与所有文件分开。
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!