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

replace tshy in module-replacements #60

Closed
kravetsone opened this issue Jun 29, 2024 · 4 comments
Closed

replace tshy in module-replacements #60

kravetsone opened this issue Jun 29, 2024 · 4 comments

Comments

@kravetsone
Copy link

Why u use it as package builder?

https://www.npmjs.com/package/tshy?activeTab=dependencies

image

It uses the packages that you say should be replaced...

I suggest use pkgroll instead

@43081j
Copy link
Contributor

43081j commented Jun 30, 2024

it does a fairly good job. the usual two choices for dual packages are tsup and tshy from what i've seen

tsup bundles the sources twice (which looks like what pkgroll does too), and tshy just builds via tsc twice

are you concerned about the dependency tree depth?

@AbhiPrasad
Copy link
Contributor

AbhiPrasad commented Jul 1, 2024

tshy is great, I don't think it's a huge deal that the packages in the module-replacements list are being used because rimraf and similar is most just there to deal with glob. Here is an example: https://github.com/isaacs/sync-content/blob/acdce90c55eecc603945c935bffbbd3d377f1e2e/src/index.ts#L219-L220.

tshy also doesn't use rollup, which does help keep it light.

pkgroll uses an outdated version of glob, which brings in the deprecated inflight, so feels like a worse option atm. It also brings in the whole rollup ecosystem, which is heavy in it's own right.

bunchee is another similar all-in-one dual emitting solution that I really like, but it has an even bigger dep tree than pkgroll (and also is rollup-based)

Then there is unbuild which I like so much I even did a conference talk about using it, but it has the biggest dep tree of all (why load cssnano for just bundling a simple isomorphic js lib 😭). It's the most extensible of all the options (with escape hatches to run custom rollup plugins), so it's great for more complicated monorepos like what I deal with at my day job.

@43081j
Copy link
Contributor

43081j commented Jul 1, 2024

makes sense

i think lets keep this on tshy for now with the ultimate aim of just moving to esm-only (can't really until eslint can load esm plugins)

unbuild is more than we need here but @pi0 and @danielroe seem pretty interested in the e18e stuff, so im sure they'd be open to suggestions for making it lighter 👀

@pi0
Copy link

pi0 commented Jul 1, 2024

Thanks for feedback and kind words dear @AbhiPrasad @43081j. Let's track it upstream: unjs/unbuild#405

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

4 participants