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

[Feature Request] cjs/esm 构建输出包含 package.json #512

Open
leohxj opened this issue Sep 9, 2022 · 0 comments
Open

[Feature Request] cjs/esm 构建输出包含 package.json #512

leohxj opened this issue Sep 9, 2022 · 0 comments

Comments

@leohxj
Copy link

leohxj commented Sep 9, 2022

当构建的包用于node环境下, 需要区分 type 类型, 如果只在根目录下的 package.json 配置一种 type, 那么无法运行时区分 esm, cjs 目录下 .js 文件的模块类型.

所以要么 esm/cjs 配置型添加一个后缀类型的输出, 可配置 mjs, cjs 后缀格式

要么就是输出的子目录中包含一个 package.json 文件, 指明 type, 个人建议这种方案.

参考: UNPKG - axios-retry

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