Option 'noEmit' cannot be specified with option 'incremental'

后端 未结 2 1846
慢半拍i
慢半拍i 2021-02-19 20:38

I am developing a next.js app. It has the following tsconfig.js

{
  \"compilerOptions\": {
    \"target\": \"ES2018\",
    \"module\": \"esnext\",
          


        
2条回答
  •  后悔当初
    2021-02-19 20:41

    From TypeScript issue #33809:

    It really doesn't make sense to have incremental and noEmit together, since noEmit prevents us from writing incremental metadata. (So nothing is actually incremental).

    You should consider emitDeclarationOnly instead of noEmit, if you actually just want incremental checking.

    According to this, the incremental: true flag has done nothing to speed up the build while noEmit: true is defined. So you should either remove noEmit: true or change it to emitDeclarationOnly: true.

    You can control the output folders using outDir and declarationDir.

提交回复
热议问题