2016-10-21 10 views
2

だから、燃えさし-CLI-builds.jsファイルは明らかにエンバーCLIにインポートES6ファイルエンバー-CLI-builds.js

// If the library that you are including contains AMD or ES6 
// modules that you would like to import into your application 
// please specify an object with the list of modules as keys 
// along with the exports of each module as its value. 

私は

app.import('vendor/global.js'); 
通常のJavaScriptファイルをこのようにインポートしていますを述べて

しかし、 "モジュールのリストを持つオブジェクトをキーとして指定し、各モジュールのエクスポートを値として"指定する適切な方法は何ですか?ガイドの見出し「AMD Javascriptのモジュール」で

+0

あなたは 'app.importみました({ "グローバル":app.import( 'ベンダー/ global.js') //など を});' –

答えて

2

は、それがそのように説明されています

最初の引数、およびモジュール と第二として、輸出のリストとして資産・パスを提供します。

app.import('bower_components/ic-ajax/dist/named-amd/main.js', { 
    exports: { 
    'ic-ajax': [ 
     'default', 
     'defineFixture', 
     'lookupFixture', 
     'raw', 
     'request' 
    ] 
    } 
}); 

あなたのアプリでimportに変更できます。 (例えばimport { raw as icAjaxRaw } from 'ic-ajax';

リファレンスFrom Guide

+1

ありがとう@ykaragol –

関連する問題