2017-11-25 43 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

工作就像一个魅力。谢谢 –

相关问题