Mitosis Import Plugin #1762
arthur-fontaine
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! 👋
Today I built an Esbuild plugin that lets you import Mitosis components without needing create a
library
folder/package.The goal was to make Mitosis feel more "native" and "fluent" within the framework I use, while still benefiting from its ability to decouple UI from any specific framework.
The plugin can auto-detect the framework used (without needing to specify the target in the import attribute) and detect when an import is a Mitosis component automatically. Those two features together allows to import a Mitosis component as any other component.
Currently, the plugin only works with Esbuild since it's the easiest build tool to use import attributes with (which the plugin relies on). But as soon as other build tools support them I will add compatibility (it should only take a few lines of code).
In the future, I want to
auto-detect the framework used (without needing to specify the target in the import attribute)(done ✅)detect when an import is a Mitosis component automatically(done ✅)Here is a demo video!
Enregistrement.de.l.ecran.2025-05-17.a.21.24.13.mov
You can see how to use it on the GitHub.
Resources:
Beta Was this translation helpful? Give feedback.
All reactions