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

moduleResolution shouldn't be set as bundler #47

Open
XiNiHa opened this issue Oct 29, 2024 · 2 comments
Open

moduleResolution shouldn't be set as bundler #47

XiNiHa opened this issue Oct 29, 2024 · 2 comments

Comments

@XiNiHa
Copy link

XiNiHa commented Oct 29, 2024

Currently, the moduleResolution option of the seroval package is set as Bundler, and this makes users without bundlers unable to consume the package correctly.

Since seroval uses Bundler and doesn't perform any postprocessing of module resolutions before publishing, module specifiers that only work with Bundler gets uploaded as-is on NPM and it breaks users who use stricter moduleResolution options like NodeNext, which forces users to utilize additional tools (bundlers, transpilers, etc) to perform additional module resolution.

If keeping the moduleResolution option as Bundler is desired, it should be fixed in pridepack to perform module resolution process during build to convert all module specifiers to be compatible with NodeNext.

@lxsmnsyc
Copy link
Owner

hmmmm, I've tried NodeNext before...it's actually the least compatible in my project setups. Bundler hits right for my needs, and it meets the requirement that is in common between runtimes and bundlers. Of course the only thing I'm only doing wrong is that the JS bundles aren't colocated with their type definitions.

This will remain unchanged until I'm convinced.

@XiNiHa
Copy link
Author

XiNiHa commented Oct 31, 2024

it meets the requirement that is in common between runtimes and bundlers

Do you mean the part that alternative runtimes like Deno can't resolve files when .js extension is used? I believe that should be handled using allowImportingTsExtensions and rewriteRelativeImportExtensions, not by using Bundler.

Using Bundler in a library without any postprocessing results in a major breakage: (ref)

As you can see, the library is completely broken for users who use NodeNext. This is not good, especially because every library that depends on seroval should also use Bundler to use the library, leading to more breakage in the whole ecosystem. Considering all of these, could you reconsider about moving away from Bundler?

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

2 participants