2017-11-25 58 views
0

我正在爲systemjs的映射路徑苦苦掙扎。子目錄的SystemJS軟件包配置路徑圖

以下是我目前的配置。 我想@angular-redux/form/dist/source/connect@angular-redux/form/dist/source/connect/index.js

但它一直引導到 @angular-redux/form/dist/source/connect.js

我假設我不寫正確的地圖或我應該使用元,而不是... 可能有人走到我通過?

'use strict'; 
 
/** 
 
* System configuration for Angular samples 
 
* Adjust as necessary for your application needs. 
 
*/ 
 
(function() { 
 
    System.config({ 
 
    paths: { 
 
     // paths serve as alias 
 
     'npm:': '../node_modules/' 
 
    }, 
 
    // map tells the System loader where to look for things 
 
    map: { 
 
     "@angular-redux/form": "npm:@angular-redux/form" 
 
    }, 
 
    // packages tells the System loader how to load when no filename and/or no extension 
 
    packages: { 
 
     '@angular-redux/form': { 
 
     main: 'dist/source/index.js', 
 
     map: { 
 
      './connect': './connect/index.js', 
 
      './connect-array': './connect-array/index.js' 
 
     } 
 
     } 
 
    } 
 
    }); 
 
})(this);

回答

1

我不認爲你映射到正確的位置。

,如果你有

import '@angular-redux/form/dist/source/connect' 

的映射必須是這個東西類似:如果你有

'./dist/source/connect': './dist/source/connect/index.js', 
'./dist/source/connect-array': './dist/source/connect-array/index.js' 

import '@angular-redux/form/connect' 

映射需要是這一個類似於:

'./connect': './dist/source/connect/index.js', 
'./connect-array': './dist/source/connect-array/index.js' 
+0

工作就像一個魅力。謝謝 –

相關問題