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

bug: .js extension added to a sub-dependency after bundling #113

Open
1 task done
KaisSalha opened this issue Jun 9, 2024 · 1 comment
Open
1 task done

bug: .js extension added to a sub-dependency after bundling #113

KaisSalha opened this issue Jun 9, 2024 · 1 comment

Comments

@KaisSalha
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

The dependency matcher works after bundling is done, this fails because subdependencies aren't matched.

https://github.com/KaisSalha/esbuild-plugin-file-path-extensions-bug/blob/76f3f4a4fdc5fc6fc0c0def14b738b1335d538f6/dist/index.js#L15265

I can look into this some time later, but I'll busy for a while.

Steps To Reproduce

https://github.com/KaisSalha/esbuild-plugin-file-path-extensions-bug/tree/with-fix

Expected behavior

Have it work without bundling?
Have it run before bundling?
Rethink dependency matcher?

Screenshots

No response

Additional context

No response

@favna
Copy link
Member

favna commented Jun 10, 2024

Man... this hole just keeps getting bigger and bigger doesn't it :(

Here I was trying to make a cool extension to output files in a library so they can be subpath imported as well as cross compiled for CJS and ESM (for example it's used in https://github.com/sapphiredev/utilities/tree/main/packages/utilities) but then this plugin became more and more popular and now there's lot of edge cases to account for. Not that I mind the rising popularity, on the contrary, but it's still a bother for all users.

As for a way to fix it, maybe instead of just scanning package.json the code should recursively scan all subdependencies?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants