2017-12-11 1 views
0

나는 다음과 같은 오류 얻을 :오류 : 파일을 쓸 수 없습니다 '...'이 allowJS 및 OUTDIR 옵션을 사용하여 입력 파일을 덮어 쓰기 때문에

Building error

tsconfig.json 파일을

{ 
    "compileOnSave": false, 
    "compilerOptions": { 
    "allowJs": true, 
    //"outFile": "./dist/out-tsc", 
    "outDir": "./dist", 
    "sourceMap": true, 
    "declaration": false, 
    "moduleResolution": "node", 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "target": "es5", 
    "typeRoots": [ 
     "node_modules/@types" 
    ], 
    // "exclude": [ 
    // "node_modules" 
    // ], 
    "lib": [ 
     "es2017", 
     "dom" 
    ] 
    } 
} 

tsconfig.app.json 파일 :

"extends": "../tsconfig.json", 
    "compilerOptions": { 
    "allowJs": true, 
    //"noEmit": true, 
    //"outFile": "../out-tsc/app", 
    "outDir": "../out-tsc/app", 
    "baseUrl": "./", 
    "module": "es2015", 
    "types": [] 
    }, 
    "exclude": [ 
    "node_modules", 
    "public", 
    "test.ts", 
    "**/*.spec.ts" 
    ] 

주석 처리가 해제 된 경우 noEmit 프로젝트가 성공적으로 실행되었지만 비어 있습니다.

Angular CLI: 1.6.0 
Node: 8.9.1 
OS: win32 x64 
Angular: 5.1.0 

angular/cli: 1.6.0 
angular-devkit/build-optimizer: 0.0.35 
angular-devkit/core: 0.0.22 
angular-devkit/schematics: 0.0.41 
ngtools/json-schema: 1.1.0 
ngtools/webpack: 1.9.0 
schematics/angular: 0.1.10 
schematics/schematics: 0.0.10 
typescript: 2.4.2 
webpack: 3.10.0 

관련 링크 : https://github.com/Microsoft/TypeScript/wiki/FAQ#why-am-i-getting-the-error-ts5055-cannot-write-file-xxxjs-because-it-would-overwrite-input-file-when-using-javascript-files

답변

0

이 tsconfig 나를 위해 작동합니다

{ 
    "compileOnSave": false, 
    "compilerOptions": { 
    "allowJs": true, 
    "outDir": "./out-tsc", 

    "allowSyntheticDefaultImports": true, 
    "sourceMap": true, 
    "declaration": false, 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "traceResolution": true, 
    "target": "es5", 
    "baseUrl": "./src", 
    "paths": { 
     // APP 
     "app/*": ["./app/*"], 
     "components/*": ["./app/components/*"], 
     "services/*": ["./app/services/*"], 
     "global/*": ["./app/global/*"], 
     // ASSETS 
     "assets/*": ["./assets/*"], 
     // SHARED 
     "shared/*": ["./shared/*"], 
     "abstract/*": ["./shared/abstract/*"], 
     "interfaces/*": ["./shared/interfaces/*"] 
    }, 
    "typeRoots": [ 
     "node_modules/@types" 
    ], 
    "lib": [ 
     "es2017", 
     "dom" 
    ] 
    } 
} 

그리고 tsconfig.app :

{ 
    "extends": "../tsconfig.json", 
    "compilerOptions": { 
    "outDir": "../out-tsc/app", 
    "baseUrl": "./", 
    "module": "es2015", 
    "types": [] 
    }, 
    "exclude": [ 
    //"../node_modules/**", 
    "public", 
    "test.ts", 
    "**/*.spec.ts" 
    ] 
} 
관련 문제