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

Use unbuild for build system #66

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Holi0317
Copy link

@Holi0317 Holi0317 commented Mar 3, 2024

Fixes #63.

Import of mimetext has been broken since v3.0.19 in both CJS and ESM node. Bundler environment is still working.

arethetypeswrong can check and verify this:

image

While the entrypoint are correctly advertised as cjs/esm and they are using correct require/import statements, all entrypoints are trying to require/import .js file and it breaks cjs imports. Because the import are not rewritten with correct path.

This PR replaces the rollup+babel build system with unbuild. There might be some breaking changes introduced by this:

  • Minimum node version set to 18 (current supported version) just to set a baseline. This was never mentioned anywhere in the repo before
  • Babel and corejs are removed. .browserslistrc, while still in the repo, was no longer read by build system. The browser build probably won't run on IE10
  • Change build directory from build to dist because that's unbuild's convention. If this is a bit annoying we can write a config for unbuild to change that

@muratgozel
Copy link
Owner

muratgozel commented Mar 8, 2024

just heard about this tool, looks better than tsup. i will give it a try, thank you @Holi0317

plus, there is also pkgroll

@Holi0317
Copy link
Author

Yeah I also saw pkgroll exist.

Now that you've fixed the packaging, do you want to move forward with unbuild, pkgroll, tsup or keep the packaging infrastructure as is?

I don't think I should be making any big decision here but I am more than happy to experiment with different tools and see which fits.

@muratgozel
Copy link
Owner

i prefer to trust tsup for now as its more mature compared to others so gonna leave the packaging as it is. i will use the bundler we gonna choose here in my other packages as well so i want to be sure its good enough.

i will give both unbuild and pkgroll a try in one of my other packages.

are you able to compare any of these three bundlers? i mean have you used them?

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

Successfully merging this pull request may close these issues.

CJS version of [email protected]+ can't be imported, ESM issues
2 participants