未找到 SystemJS Angular2 引导加载程序

SystemJS Angular2 boot loader not found

当我尝试从布局页面导入 boot.js 时,我不断收到 404 错误。

这是我用来导入它的代码:

<!-- Configure SystemJS -->
<script src="/appScripts/config.js"></script>
<script>
        System.import('/appScripts/boot')
              .then(null, console.error.bind(console));
</script>

这是我的文件夹结构:

当我使用 index.html 时一切正常(在 wwwroot 中看到),但当我从 /views/shared/_layout.cshtml

尝试时却不行

这是我的 config.js

(function (global) {

    // map tells the System loader where to look for things
    var map = {
        'app': 'appScripts', // 'dist',
        'rxjs': 'libs/rxjs',
        'angular2-in-memory-web-api': 'libs/angular2-in-memory-web-api',
        '@angular': 'libs/@angular'
    };

    // packages tells the System loader how to load when no filename and/or no extension
    var packages = {
        'app': { main: 'boot.js', defaultExtension: 'js' },
        'rxjs': { defaultExtension: 'js' },
        'angular2-in-memory-web-api': { defaultExtension: 'js' },
    };

    var packageNames = [
      '@angular/common',
      '@angular/compiler',
      '@angular/core',
      '@angular/http',
      '@angular/platform-browser',
      '@angular/platform-browser-dynamic',
      '@angular/router',
      '@angular/router-deprecated',
      '@angular/testing',
      '@angular/upgrade',
    ];

    // add package entries for angular packages in the form '@angular/common': { main: 'index.js', defaultExtension: 'js' }
    packageNames.forEach(function (pkgName) {
        packages[pkgName] = { main: 'index.js', defaultExtension: 'js' };
    });

    var config = {
        map: map,
        packages: packages
    }

    // filterSystemConfig - index.html's chance to modify config before we register it.
    if (global.filterSystemConfig) { global.filterSystemConfig(config); }

    System.config(config);

})(this);   

非常感谢您的帮助,如果您需要更多信息,请告诉我。

我以为我已经尝试过了,但是很难跟踪这一切。这是我解决这个问题的方法。注意 baseURL 行。

<!-- Configure SystemJS -->
<script>System.config({ baseURL: '/' });</script>
<script src="/appScripts/config.js"></script>
<script>
    System.import('appScripts/boot').catch(console.log.bind(console));
</script>