Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsconfigPath配置文件没有尊重include #381

Open
3 tasks done
bosens-China opened this issue Sep 6, 2024 · 6 comments
Open
3 tasks done

tsconfigPath配置文件没有尊重include #381

bosens-China opened this issue Sep 6, 2024 · 6 comments
Labels
pending Need further confirmation

Comments

@bosens-China
Copy link

Describe the bug

在项目tsconfig.json中排除output文件夹,但是在指定的tsconfigPath配置文件中包含output,会导致生成的类型文件不正确。

  • tsconfig.json
{
 "exclude": ["output"]
}
  • tsconfig.app.json
{
  "extends": "./tsconfig.json",
  "compilerOptions": {},
  "include": ["./scripts/batchUpload/buildingDependencies.ts", "./output/*.ts"]
}
  • vite.config.ts
{
  plugins: [
    dts({
      rollupTypes: true,
      tsconfigPath: './tsconfig.app.json',
    }),
  ],}

Reproduction

暂无

Steps to reproduce

No response

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 16.40 GB / 31.86 GB
  Binaries:
    Node: 20.0.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 9.6.4 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.9.0 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (128.0.2739.54)
    Internet Explorer: 11.0.22621.3527

Validations

@qmhc qmhc added the need reproduction Should provide a reproduction label Sep 6, 2024
@bosens-China
Copy link
Author

https://github.com/new-concept-english/source

@qmhc 这个仓库可以让你复现😁

@qmhc qmhc removed the need reproduction Should provide a reproduction label Sep 8, 2024
@qmhc
Copy link
Owner

qmhc commented Sep 8, 2024

复现步骤以及预期错误是怎么样的呢?

@bosens-China
Copy link
Author

复现步骤以及预期错误是怎么样的呢?

  1. 克隆仓库,安装依赖
  2. 更改根目录tsconfig.json exclude": ["output"]
  3. 运行 pnpm run build
  4. 观察dist下index.d.ts文件

@qmhc
Copy link
Owner

qmhc commented Sep 13, 2024

没有看到你项目里包含 output 文件夹。

@bosens-China
Copy link
Author

没有看到你项目里包含 output 文件夹。

@qmhc
问题描述的复现步骤有点简陋补充一下:

  1. npm run batch-upload
  2. 回生成output
  3. 执行 npm run build

可以观察到输出

@qmhc
Copy link
Owner

qmhc commented Sep 26, 2024

按照你的步骤并没有发生构建错误,也没看到 dist/index.d.ts 有错误。

或许你可以试试在 https://stackblitz.com/ 上创建一个项目复现后,分享一下链接。

@qmhc qmhc added the pending Need further confirmation label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending Need further confirmation
Projects
None yet
Development

No branches or pull requests

2 participants