tinylibs / tinybench

🔎 A simple, tiny and lightweight benchmarking library!
MIT License
1.73k stars 36 forks source link

`pLimit` should be a direct dependency #84

Closed ematipico closed 2 months ago

ematipico commented 2 months ago

The package pLimit is marked a development dependency, but it's in a couple of places inside the src/ folder.

Is it a mistake?

Aslemammad commented 2 months ago

The reason for that is so the dependency get bundled into the output! That's why some of the deps are dev deps.

ematipico commented 2 months ago

Then, I think it should be placed in the correct place: https://docs.npmjs.com/cli/v10/configuring-npm/package-json#bundledependencies

JReinhold commented 2 months ago

Based on my understanding, bundleDependency would put the whole dependency in the package's tarball. But tsup doesn't handle bundleDependency at all. So you'd end up with tsup bundling the code into the final bundle, but also npm including the dependency in the tarball. You'd basically have the code twice.

However if you also moved it from a devDependency to a dependency, then tsup would not bundle it in. So that could work. However you'd miss the minification of tsup, so the final download size would probably increase. And I'm not sure what the point would be.

(This is all based on theoretical understanding, I haven't actually tried the bundleDependency property before)

ematipico commented 2 months ago

Oh, I see. If that's what you said is correct, then it's a pity.

Feel free to close it it's no longer relevant

Aslemammad commented 2 months ago

Thank you so much!

Aslemammad commented 2 months ago

Thank you @JReinhold for the explanation too!