簡體   English   中英

React-native typescript 模板未編譯 tsc、tsx 文件

[英]React-native typescript template not compiling tsc, tsx fles

我創建了一個帶有空白(TypeScript)模板的新 expo 應用程序,並像這樣在 package JSON 文件中創建了一個腳本條目。

"compile-project":"tsc --watch"

但是在運行“compile-project”命令時,該項目沒有編譯我的項目目錄中的任何 tsc、tsx 文件。

這是我的 tsconfg 文件

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "jsx": "react-native",
    "lib": ["dom", "esnext"],
    "moduleResolution": "node",
    "noEmit": true,
    "skipLibCheck": true,
    "resolveJsonModule": true,
    "strict": true
  }
}

看起來您正在設置通過提供noEmit: true來停止發出文件。 此選項僅對檢查打字有用。

嘗試將其切換回false以查看output中的編譯文件:

tsconfig.json

{
  "compilerOptions": {
    // ...
    "noEmit": false,
  } 
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM