3

我在用着ember-cli 0.0.33

我使用创建了一个默认应用程序

ember new stealth

然后我使用

ember build --environment=production

index然后我将文件上传到文件,https://d1mungh8jer63d.cloudfront.net/index.html然后在其中打开url并得到一个空白的白色屏幕。asset../assets/*indexChromeFirefox

接下来,没有改变任何东西,我跑了

ember s --environment=production --live-reload=false

这给了我完全相同的dist文件。我打开我的浏览器,localhost:4200页面有Welcome to Ember.js.

但两者index.html都有localhost:4200相同的来源:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Stealth</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <base href="/" />

    <link rel="stylesheet" href="https://d1mungh8jer63d.cloudfront.net/assets/vendor-d41d8cd98f00b204e9800998ecf8427e.css">
    <link rel="stylesheet" href="https://d1mungh8jer63d.cloudfront.net/assets/stealth-de3c495d5da3bffcdc865aaa60f76ab3.css">
  </head>
  <body>
    <script>
      window.StealthENV = {"baseURL":"/","locationType":"auto","EmberENV":{"FEATURES":{}},"APP":{}};
      window.EmberENV = window.StealthENV.EmberENV;
    </script>
    <script src="https://d1mungh8jer63d.cloudfront.net/assets/vendor-5429f75166356b28c3e42dd401abaf36.js"></script>
    <script src="https://d1mungh8jer63d.cloudfront.net/assets/stealth-271c63d147abd689113e3c0bae25a9e5.js"></script>
    <script>
      window.Stealth = require('stealth/app')['default'].create(StealthENV.APP);
    </script>
  </body>
</html>

为什么一个“工作”/显示Welcome to Ember.js,而另一个只是显示一个空白的白色屏幕?我如何使index.html“工作”?

4

1 回答 1

3

(OP能够解决他自己的问题。我只是在这里粘贴他自己的答案,所以可以找到)

如果需要将 ember 项目部署到子目录,请使用baseUrl配置。

于 2014-06-30T13:49:55.873 回答