SystemJS包配置子目录的路径映射

时间:2017-11-25 21:29:58

标签: angular systemjs

我正在努力使用systemjs的映射路径。

以下是我目前的配置。 我希望@angular-redux/form/dist/source/connect成为。{1}} @angular-redux/form/dist/source/connect/index.js

但它一直指向 @angular-redux/form/dist/source/connect.js

我假设我没有写出正确的地图,或者我应该使用meta而不是...... 有人可以带我走过吗?

'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);

0 个答案:

没有答案