我看到Angular2啓動項目的System.Config.JS爲例前綴配置地圖包的名稱,它下面喜歡:命名空間+冒號
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
'app': 'app',
// angular bundles
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js'
},
我的問題是:地圖似乎採用的配置路徑的別名,如「故宮',後綴爲冒號「:」,然後將此字符串前置到包文件名,例如npm:@ angular/forms/bundles/forms.umd.js。
但是我擡頭看了一下SystemJS的config API和RequireJS的config,但是我沒有找到任何這種用法的文檔。有沒有人有過這方面的工作,並可以提供一些有用的鏈接或文件。先謝謝你。
哦,對了,我錯過了「npm:」整個部分是一個配置路徑散列表鍵,不僅僅是「npm」。謝謝你指給我。 – IcyBrk