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

father v4 是否可以指定 d.ts 声明文件的输出路径 #510

Open
leohxj opened this issue Sep 8, 2022 · 4 comments
Open

father v4 是否可以指定 d.ts 声明文件的输出路径 #510

leohxj opened this issue Sep 8, 2022 · 4 comments

Comments

@leohxj
Copy link

leohxj commented Sep 8, 2022

现在 d.ts 只有 esm/cjs 的时候, 自动生成在对应的目录, umd 不会构建 d.ts 吧?

能否支持单独生成 .dts 声明文件, 并且配置对应的输出路径 ?
这样在构建 esm/cjs 的时候, d.ts 的输出只处理一次.

@PeachScript
Copy link
Member

PeachScript commented Sep 9, 2022

  1. umd 没法单独生成 bundle 的 d.ts,类型声明的打包问题比较多,目前没有稳定的方案;father 可能可以加个自动执行 tsc --emitDeclarationOnly 的能力,仅 tsconfig.json 里配置了 declaration: true 且只有 umd 产物时生效?
  2. cjs/esm 产物内容不一定完全一致的,所以类型也不一定能共用,取决于用户配置
  3. d.ts 生成是有持久缓存的,所以执行效率上应该影响不大

@leohxj
Copy link
Author

leohxj commented Sep 9, 2022

恩, 可能组件走远程加载的时候, 才需要只构建 umd, 那对应的类型申明暂时没有直接输出的方式, 可以考虑.

@spt110
Copy link

spt110 commented Feb 8, 2023

umd 单独生成 bundle 的 d.ts 有方案吗?

恩, 可能组件走远程加载的时候, 才需要只构建 umd, 那对应的类型申明暂时没有直接输出的方式, 可以考虑.

umd 单独生成 bundle 的 d.ts 有方案吗?

@Flcwl
Copy link

Flcwl commented Apr 14, 2023

建议支持,支持单独生成 ts 类型定义。 虽然 tsc 可以,但是从库设计角度建议支持,不感知底层

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants