8000 Problem:tsup 构建出现别名引用错误,造成循环引用声明 · Issue #1320 · egoist/tsup · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Problem:tsup 构建出现别名引用错误,造成循环引用声明 #1320

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

Open
iqseternal opened this issue Mar 17, 2025 · 0 comments
Open

Comments

@iqseternal
Copy link
iqseternal commented Mar 17, 2025

我最近在做将 某个主项目 的类型进行打包输出为到指定文件夹,我的主项目中含有(declare.ts)

Image
然后在 tsconfig.json 的 types 中指定了一个文件夹,文件夹中含有类型 index.d.ts,内容为:

Image

其中将主项目中的类型通过一系列组合成一个比较大的命名空间:Rapid。然后可以在项目的任何地方使用这个较大的命名空间。在我的主项目中,使用正常。

然后我配置了 tsup,以 tsconfig.json 的 types 为入口进行打包(包含上述的 index.d.ts),以及我的主项目中所对于的 ts 文件作为入口(包含上述 declare.ts ),同时进行打包。
但是打包输出的最终文件中,出现了引用混乱

Image

最终生成的声明文件中,tsup错误的修改了我的文件的导入别名,并且在我声明全局的命名空间时,给我造成了循环引用。

@iqseternal iqseternal changed the title Problem Problem:tsup 构建出现别名引用错误,造成循环引用声明 Mar 17, 2025
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

1 participant
0