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>

1 つが "work"/displayWelcome to Ember.jsであるのに、もう 1 つが空白の白い画面を表示したのはなぜですか? そして、どのようにindex.html「仕事」をするのですか?

4

1 に答える 1

3

(OPは彼自身の問題を解決できました。私はここに彼自身の答えを貼り付けているので、見つけることができます)

サブディレクトリに ember プロジェクトをデプロイする必要がある場合は、構成を使用しbaseUrlます。

于 2014-06-30T13:49:55.873 に答える