2017-02-15 2 views
0

프로젝트에 정의되지 않은 타사 라이브러리가 사용됩니다. Angular CLI (버전 1.0.0-beta.29)를 사용하여 프로젝트를 개발하면이 라이브러리는 typings.d.ts으로 선언됩니다. 제 경우에는 : 'xml2js-es6-promise'모듈을 선언하십시오;ngc 형식화되지 않은 타사 라이브러리를 사용하여 프로젝트를 컴파일하지 않습니다.

프로젝트가 컴파일되어 tsc에서는 제대로 처리되지만 ngc에서는 사용되지 않습니다. 오류 추적 :

Cannot find module ‘xml2js-es6-promise’ 

tscconfig : 제 3자는 라이브러리 생성되는 ngsummary.json 파일을 포함해야한다

{ 
 “compilerOptions”: { 
 “baseUrl”: “.”, 
 “declaration”: true, 
 “stripInternal”: true, 
 “experimentalDecorators”: true, 
 “strictNullChecks”: false, 
 “noImplicitAny”: false, 
 “module”: “es2015”, 
 “moduleResolution”: “node”, 
 “paths”: { 
 “@angular/core”: [“node_modules/@angular/core”], 
 “rxjs/*”: [“node_modules/rxjs/*”], 
 “xml2js-es6-promise”:[“node_modules/xml2js-es6-promise”] 
 }, 
 “rootDir”: “.”, 
 “outDir”: “dist”, 
 “sourceMap”: true, 
 “inlineSources”: true, 
 “target”: “es5”, 
 “skipLibCheck”: true, 
 “lib”: [ 
 “es2015”,  
 “dom” 
 ] 
 }, 
 “files”: [ 
 “index.ts” 
 ], 
 “angularCompilerOptions”: { 
 “strictMetadataEmit”: true 
 } 
} 

답변

0

NGC 컴파일 (AOT) 동안. 그렇지 않으면 프로젝트를 미리 컴파일 할 수 없습니다.

관련 문제