에러메시지
Cannot write file '파일경로/파일명.js' because it would overwrite input file.ts
해결방법
1. allowJs: true설정을 사용하지 않기
근본적인 해결방법은 아니지만 .js 파일을 사용하지 않을거라면 allowJs: false해서 warning을 없앨수있다. (임시방편) 근본적인 해결방법이 아니기도하고, js 확장자가 필요한 상황이라 다른 방법을 찾아보았다.
2. 👍🏻 outDir
를 설정하고 exclude
에 포함시키기
{
compilerOptions: {
..., // 생략
outDir: "dist" // "./" 붙일 필요 없음
},
exclude: ["node_modules", "dist"]
}
728x90
'frontend' 카테고리의 다른 글
[TypeScript] JSON파일 import하기 (0) | 2022.09.16 |
---|---|
Warning: React version not specified in eslint-plugin-react settings. (0) | 2022.09.10 |
[RTK-Query] Warning: Middleware for RTK-Query API at reducerPath "api명" has not been added to the store. (0) | 2022.08.08 |
[npm] Failed to install dependencies - npm 7 버전 (0) | 2022.08.08 |
[ESlint] Unexpected console statement. eslint(no-console) (0) | 2022.08.07 |