web-infra-dev / rslib

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

[Bug]: Rslib build breaks shebang line in bin file #166

Open chenjiahan opened 2 months ago

chenjiahan commented 2 months ago

Version

System:
    OS: macOS 14.6.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 2.72 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 128.0.6613.86
    Safari: 17.6
  npmPackages:
    @rslib/core: 0.0.4 => 0.0.4

Details

Rslib build breaks shebang line in bin file:

image

image

image

Reproduce link

https://github.com/web-infra-dev/rsbuild/tree/8a2a850aad336b726e50b2b1bb203d8c72c1c48a/packages/create-rsbuild

Reproduce Steps

  1. pnpm i
  2. pnpm build
fi3ework commented 2 months ago

Shortly we could use https://github.com/shuangwhywhy/webpack-shebang-plugin. In longterm, we could considering making this a built-in plugin to webpack / Rspack.

chenjiahan commented 2 months ago

Yes, we can add a built-in plugin to webpack and Rspack when the target is node.