2014-10-26 50 views
12

我正在使用ember-cli來構建我的應用程序。ember-cli元配置/環境文件

它將所有文件編譯到dist/目錄。

但是,當我檢查編譯的index.html我注意到它正在創建這個元標記。

<meta name="user/config/environment" content="%7B%22modulePrefix%22%3A%22user%22%2C%22environment%22%3A%22development%22%2C%22baseURL%22%3A%22/%22%2C%22locationType%22%3A%22auto%22%2C%22contentSecurityPolicy%22%3A%7B%22default-src%22%3A%22%27none%27%20localhost%22%2C%22script-src%22%3A%22%27self%27%20%27unsafe-inline%27%20%27unsafe-eval%27%20use.typekit.net%20connect.facebook.net%20maps.googleapis.com%20maps.gstatic.com%22%2C%22font-src%22%3A%22%27self%27%20data%3A%20use.typekit.net%22%2C%22connect-src%22%3A%22%27self%27%20localhost%22%2C%22img-src%22%3A%22%27self%27%20www.facebook.com%20p.typekit.net%22%2C%22style-src%22%3A%22%27self%27%20%27unsafe-inline%27%20use.typekit.net%22%2C%22frame-src%22%3A%22s-static.ak.facebook.com%20static.ak.facebook.com%20www.facebook.com%22%7D%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%7D%2C%22APP%22%3A%7B%22LOG_ACTIVE_GENERATION%22%3Atrue%2C%22LOG_VIEW_LOOKUPS%22%3Atrue%7D%2C%22exportApplicationGlobal%22%3Atrue%7D"> 

這是我目前使用的另一頁中的餘燼,應用程序,並且需要這個元標記爲灰燼應用程序的工作是我的部署問題。有沒有辦法使這個作爲JavaScript編譯文件的一部分或完全擺脫這一點?

+0

你的ENV設置爲生產而建? 'ember build --environment = production' – 2014-10-28 11:29:11

回答

18

來構建應用程序沒有這個最近在this PR

添加你可以設置它通過傳遞storeConfigInMeta選項是在編譯的JS輸出的能力。要選擇退出,它應該像這樣在你的Brocfile.js

/* global require, module */ 

var EmberApp = require('ember-cli/lib/broccoli/ember-app'); 

var app = new EmberApp({ 
    storeConfigInMeta: false 
}); 

module.exports = app.toTree(); 

這是提供燼-CLI 0.1.2這是最新版本,現在

+0

謝謝! – user391986 2014-10-30 03:55:22

+3

現在是'ember-cli-build.js' – intrepion 2016-05-02 10:41:57