部署ember-cli dist会返回一个空页

时间:2015-08-08 22:00:39

标签: ember.js ember-cli

我已执行以下命令为生产环境构建ember。但是当我打开dist文件夹时,单击index.html它返回了一个空白页面。与我运行ember服务器时相比。

我用来生成dist文件夹的命令

ember build --environment production

这是我如何做dist文件夹 - >点击index.html。

这是结果。

enter image description here

这是index.html

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

    <base href="/" />
<meta name="todo-mvc/config/environment" content="%7B%22modulePrefix%22%3A%22todo-mvc%22%2C%22environment%22%3A%22development%22%2C%22baseURL%22%3A%22/%22%2C%22locationType%22%3A%22auto%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%7D%2C%22APP%22%3A%7B%22name%22%3A%22todo-mvc%22%2C%22version%22%3A%220.0.0+8f1032d8%22%7D%2C%22contentSecurityPolicyHeader%22%3A%22Content-Security-Policy-Report-Only%22%2C%22contentSecurityPolicy%22%3A%7B%22default-src%22%3A%22%27none%27%22%2C%22script-src%22%3A%22%27self%27%20%27unsafe-eval%27%22%2C%22font-src%22%3A%22%27self%27%22%2C%22connect-src%22%3A%22%27self%27%22%2C%22img-src%22%3A%22%27self%27%22%2C%22style-src%22%3A%22%27self%27%22%2C%22media-src%22%3A%22%27self%27%22%7D%2C%22exportApplicationGlobal%22%3Atrue%7D" />
<script src="/ember-cli-live-reload.js" type="text/javascript"></script>

    <link rel="stylesheet" href="assets/vendor.css">
    <link rel="stylesheet" href="assets/todo-mvc.css">


  </head>
  <body>


    <script src="assets/vendor.js"></script>
    <script src="assets/todo-mvc.js"></script>


  </body>
</html>

以下是错误消息enter image description here

1 个答案:

答案 0 :(得分:0)

我这样做是错误的。我将应用程序部署到http Web服务器。通过单击index.html结果。我通过文件协议

访问它