Ember-CLI:Ember Build不断构建错误的index.html

时间:2017-04-27 04:40:43

标签: ember.js ember-cli

理想情况下,我希望我的index.html:

<!-- app/index.html -->
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Program With Erik Blog Example</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    {{content-for 'head'}}

    <link rel="stylesheet" href="assets/vendor.css">
    <link rel="stylesheet" href="assets/example1.css">

    {{content-for 'head-footer'}}
  </head>
  <body>
    {{content-for 'body'}}

    <script src="assets/vendor.js"></script>
    <script src="assets/example1.js"></script>

    {{content-for 'body-footer'}}
  </body>
</html>

进入生产代码。但由于一些奇怪的原因,每次我调用ember构建时,我都没有得到预期的生产代码。相反,我得到这样的东西

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Welcome to Firebase Hosting</title>
    .
    .
    .
    <!-- lots of code -->

这是默认的firebase页面!

Firebase welcome page

发生了什么事?我多次删除了这张照片。但每次我调用ember构建时,都会构建firebase默认页面而不是我的ember app index.html。

我是ember的新手,我一直在使用config / environment.js和firebase.js进行大量调整。有关为什么会发生这种情况的任何想法?

1 个答案:

答案 0 :(得分:2)

在初始化firebase应用程序时,会提示一个:

? What do you want to use as your public directory? (public)

确保将dist文件夹设置为公共目录,即

? What do you want to use as your public directory? (public) dist
无论您构建Ember应用程序多少次,

使用默认public都会导致上述行为。 要解决此问题,请使用firebase init命令重新初始化firebase应用程序,并将正确的文件夹设置为公共目录。

相关问题