web-infra-dev / rslib

Create JavaScript libraries in a simple and intuitive way.
https://lib.rsbuild.dev/
MIT License
470 stars 25 forks source link

[Bug]: Dependencies in devDependencies have not been included in the build output. #469

Closed Zhang-Wei-666 closed 3 days ago

Zhang-Wei-666 commented 3 days ago

Version

System:
  OS: Windows 11 10.0.22631
  CPU: (20) x64 13th Gen Intel(R) Core(TM) i9-13900H
  Memory: 10.18 GB / 31.75 GB
Browsers:
  Edge: Chromium (128.0.2739.42)
  Internet Explorer: 11.0.22621.3527

npmPackages: "@rslib/core": "^0.1.0"

Details

devDependencies 中的依赖未被打包进产物中


Dependencies in devDependencies have not been included in the build output.

Reproduce link

https://github.com/Zhang-Wei-666/rslib-bug-report/tree/1

Reproduce Steps

运行以下命令进行构建

pnpm i && pnpm build

查看打包产物 dist/index.d.ts 中可以发现 type-fest 未被打包进去

根据 Handle Third-Party Dependencies 的描述, 默认情况下, devDependencies 中的依赖是会被打包的


Run the following command to build.

pnpm i && pnpm build

By checking the packaged product at dist/index.d.ts, it can be observed that type-fest has not been included in the package.

According to the description in Handle Third-Party Dependencies, by default, dependencies in devDependencies will be bundled.

Timeless0911 commented 3 days ago

You use bundleless DTS which is like tsc, try to set dts.bundle: true https://lib.rsbuild.dev/guide/advanced/dts#how-to-generate-dts-in-rslib

Zhang-Wei-666 commented 3 days ago

You use bundleless DTS which is like tsc, try to set dts.bundle: true https://lib.rsbuild.dev/guide/advanced/dts#how-to-generate-dts-in-rslib

这就涉及另一个问题了: #470


This brings us to another issue : #470

@Timeless0911