简体   繁体   English

Firebase Hosting仅部署2个文件

[英]Firebase Hosting only deploying 2 files

I'm trying to deploy my site to Firebase Hosting with the following commands (see below). 我正在尝试使用以下命令将网站部署到Firebase Hosting(请参见下文)。 It used to work fine, but after changing project folders today it would only deploy 1 file (see pic) and the site is not working. 它曾经可以正常工作,但是今天更改项目文件夹后,它只会部署1个文件(请参见图片),并且该站点无法正常工作。 After running firebase init and choosing no to configure as a single-page-app (reqrite all urls to /index.html) , it is now deploying 2 files to Firebase hosting (and my public folder now has 2 files in it: index.html and 404.html). 运行后firebase init ,并选择noconfigure as a single-page-app (reqrite all urls to /index.html)指数:,现在是部署2档,以火力托管(和我的公用文件夹现在有2个文件。 html和404.html)。 How can I return to deploying all 17 of my files to Firebase hosting again? 如何返回再次将所有17个文件部署到Firebase托管中?

Commands I'm using: 我正在使用的命令:

ng build --prod

firebase init

firebase deploy

在此处输入图片说明

I finally got it to deploy after: 我终于在以下地方部署了它:

1) Running firebase init and setting public directory to dist 1)运行firebase init并将公共目录设置为dist

2) Running ng build --prod . 2)运行ng build --prod This created a folder within the dist folder called 'hmn2' (my project name). 这在dist文件夹中创建了一个名为“ hmn2”(我的项目名称)的文件夹。

3) Copying all the contents within the hmn2 folder and pasting them one directory out, so they are directly under the dist folder. 3)复制hmn2文件夹中的所有内容,并将其粘贴到一个目录中,因此它们直接位于dist文件夹下。 I also deleted the 'hmn' folder. 我还删除了“ hmn”文件夹。

I'm not sure why it's putting them in another folder now (after upgrading to Angular 6). 我不确定为什么现在将它们放在另一个文件夹中(升级到Angular 6之后)。 It didn't used to do this before. 以前没有这样做。

I Had same issue with Ionic Just that below questions need to be answered correctly as below. 我与Ionic有相同的问题,只是以下问题需要正确回答,如下所示。

? 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

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

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