2017-07-18 35 views
1

我正在試圖將我的Ember項目構建到項目之外的目錄以及將來構建,我不希望每次都使用命令行標誌。 ember build --output-path=/not-dist會爲我工作,但我想Ember自動添加標誌。更改Ember編譯目錄(dist文件夾)不帶命令行標誌

outputPaths: { 
     app: { 
     html: '../presentation/index.cfm', 
     css: { 
      'app': '../presentation/assets/ember-presentation-viewer.css' 
     }, 
     js: '../presentation/assets/ember-presentation-viewer.js' 
     }, 
     vendor: { 
     css: '../presentation/assets/vendor.css', 
     js: '../presentation/assets/vendor.js' 
     } 
    } 

我已經試過這是每ember-cli documentationember-presentation-viewer.css是堅持得到建在dist目錄放置了那裏所有的其他路徑。

有沒有辦法做到這一點?

+0

你確定你也想'燼serve'在這個發展建立? – Lux

回答

0

您可以配置.ember-cli.js文件指定應始終包含在你的命令行構建的標誌(在較低的駱駝),根據Ember文檔中的this page。要更改輸出目錄,您需要添加以下行:"outputPath": "../../example-folder/presentation"

因此,最終的.ember-cli.js應該是這樣的:

{ 
    /* 
    Ember CLI sends analytics information by default. The data is completely 
    anonymous, but there are times when you might want to disable this behavior. 

    Setting `disableAnalytics` to true will prevent any data from being sent. 
    */ 
    "disableAnalytics": false, 
    "outputPath": "../../example-folder/presentation" 
} 
1

轉至package.json。更改scripts/build命令:

"scripts": { 
    "build": "ember build --output-path=/not-dist" 
}, 

從現在開始,運行:

npm run build