javascript - Expo Typescript won't build the project, no outDir is produced - Stack Overflow

I'm trying to get my typescript project to build. It has built successfully in the past with the s

I'm trying to get my typescript project to build. It has built successfully in the past with the same settings, but now it's not building even though it isn't showing any errors. I run:

npx tsc -p tsconfig.json

Where my tsconfig.json is:

{
  "pilerOptions": {
    "module": "ES6",
    "target": "ES6",
    "declaration": true,
    "outDir": "./lib",
    "strict": true,
    "jsx": "react-native",
    "skipLibCheck": true,
    "moduleResolution": "node",
    "allowSyntheticDefaultImports": true,
  },
  "include": [
    "src/**/*"
  ],
  "extends": "expo/tsconfig.base"
}

No lib folder is produced at all.

My src folder contains several typescript files, as well as an index that exports the required ponents.

I'm really confused because my project structure and settings haven't changed at all yet tsc is no longer producing the outDir or any of the files when it worked before.

I'm trying to get my typescript project to build. It has built successfully in the past with the same settings, but now it's not building even though it isn't showing any errors. I run:

npx tsc -p tsconfig.json

Where my tsconfig.json is:

{
  "pilerOptions": {
    "module": "ES6",
    "target": "ES6",
    "declaration": true,
    "outDir": "./lib",
    "strict": true,
    "jsx": "react-native",
    "skipLibCheck": true,
    "moduleResolution": "node",
    "allowSyntheticDefaultImports": true,
  },
  "include": [
    "src/**/*"
  ],
  "extends": "expo/tsconfig.base"
}

No lib folder is produced at all.

My src folder contains several typescript files, as well as an index that exports the required ponents.

I'm really confused because my project structure and settings haven't changed at all yet tsc is no longer producing the outDir or any of the files when it worked before.

Share asked Jun 16, 2021 at 13:59 ICWICW 5,8256 gold badges31 silver badges39 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

Expo is using typescript for typechecking only. Bundling files is done with Metro bundler. Thus expo/tsconfig.base has noEmit option set to true.

If you want to pile js files yourself you have to either run you mand as:

npx tsc -p tsconfig.json --noEmit false

or to set noEmit option to false in your tsconfig.json. Don't forget to remove it back in you tsconfig. Or next time on build expo will run both metro bundling and tsc typecheck and tsc pilation.

As the last resort you may stop extending expo/tsconfig.base in your tsconfig.json. But do this only if you really know what you're doing.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744860606a4597677.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信