2016-11-23 2 views
0

Я пытаюсь создать пакет JSPM с использованием версии Angular 2 2.2.1.JSPM bundle Angular 2 'sourceType: module' error

С помощью этой команды:

jspm bundle @angular/common + @angular/compiler + @angular/core + @angular/forms + @angular/http + @angular/platform-browser + @angular/platform-browser-dynamic + @angular/router + @angular/upgrade 

Результаты в этой ошибки:

err SyntaxError: jspm_packages/npm/@angular/[email protected]/src/facade/lang.js: 'import' and 'export' may appear only with 'sourceType: module' (23:0) 

ответ

0

ОКАЗЫВАЕТСЯ Angular2 поддерживает модули UMD/AMD, так JSPM может быть установлен, чтобы работать следующим образом:

"overrides": { 
    "npm:@angular/[email protected]": { 
    "format": "amd" 
    }, 
    "npm:@angular/[email protected]": { 
    "format": "amd" 
    }, 
    "npm:@angular/[email protected]": { 
    "format": "amd" 
    }, 
    "npm:@angular/[email protected]": { 
    "format": "amd" 
    }, 
    "npm:@angular/[email protected]": { 
    "format": "amd" 
    }, 
    "npm:@angular/[email protected]": { 
    "format": "amd" 
    }, 
    "npm:@angular/[email protected]": { 
    "format": "amd" 
    }, 
    "npm:@angular/[email protected]": { 
    "format": "amd" 
    }, 
Смежные вопросы