-
Notifications
You must be signed in to change notification settings - Fork 367
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
Dist contains bare imports of empty chunks in ESM output #216
Comments
Seems that this looks like an issue for me, too. We might try |
I looked into this a bit more, and the issue seems to be in Combining the options
I also tried a bunch of different configurations for Current state of the
|
Let me experiment with various bundlers and see how it goes. |
A possible approach in 2 builds:
|
I’m experimenting a bit and getting good results with Rollup. I'll share a branch when I have something that looks decent. |
I created #255 as a draft PR to show my current progress with Rollup. Can be tested with: rm -rf dist
yarn rollup -c rollup.config.mjs and then inspecting the contents of the |
Thanks! Let's see how it goes. |
In the
dist
folder produced byyarn build
, a number of.mjs
files contain bare imports for chunks which:The
dist/index.mjs
module contains 11 bare imports, looking like this:And there are 93 other
dist/**/*.mjs
files containing 148 bare imports. For instance,dist/string/camelCase.mjs
looks like this:I wonder if those bare imports for empty files or unused exports affect the performance of the package. In Node it would add unnecessary disk i/o, and in the browser it would add unnecessary HTTP requests (e.g. if loading a function from
es-toolkit
from a CDN).I suspect this was introduced by the move to
tsup
in #21, and I can see the issue in the published package all the way back to1.1.0
.It looks like there are a few issues in the https://github.com/egoist/tsup repository that might match this problem, but they haven't seen any activity. It looks like it might be a problem with multiple entries. Here are a couple issues:
egoist/tsup#730
egoist/tsup#841
The text was updated successfully, but these errors were encountered: