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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add esbuild support #995

Closed
Skyler-Wu opened this issue Jan 22, 2024 · 3 comments
Closed

Add esbuild support #995

Skyler-Wu opened this issue Jan 22, 2024 · 3 comments

Comments

@Skyler-Wu
Copy link

馃挰 Questions and Help

Hi guys, I noticed in the few past years you don't have plan to add esbuild support, in this issue, now just wanna double check that you still have no plans for esbuild support, right?

@theKashey
Copy link
Collaborator

No plans yet.

But the "integration" is only around getting required stats from the build, so we can connect the dots. Basically create an analog of webpack-plugin for esbuild/vite/you-name-it and keep the rest.

@Skyler-Wu
Copy link
Author

Thanks first, and if I wanna use esbuild-loader + webpack + loadable, without @loadable/babel-plugin, you have some suggestions?

@theKashey
Copy link
Collaborator

Sorry, it would not work. Babel is the most crucial part of instrumentation and should still happen.
As a solution you can create a custom loader that will quickly scan source file and pick the right loader to use:

  • if there is "@loadable/component" seen in the file, use babel-loader
  • use esbuild-loader in any other case

Just a few files of the whole project require extra functionality from babel-plugin, while all others do not. By mixing loaders you can combine speed of esbuild with power of babel.

There is a separate solution a little easier to implement - create a "conditional loader" and place it before esbuild:

  • it will apply loadable transformation, but not the following transpilation
  • esbuild will handle the rest

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