Support for custom generators / targets
commax89 opened this issue · 2 comments
I am interested in helping provide a feature!
Yes
Which generators are impacted?
- All
- Angular
- HTML
- Qwik
- React
- React-Native
- Solid
- Stencil
- Svelte
- Vue
- Web components
What problem does this feature solve?
Some projects may need to customize, rewrite or write generators from scratch in order to achieve some specific business requirements that are not compatible with current coding standards.
What does the proposed API look like?
From an initial high level investigation it should be possibile to load custom targets directly from the config file, in the cli package it should be enough to merge the current targets with the ones from the options. This should also enable generator replacements.
Additional Information
No response
I'm open to adding this! How to do so:
-
Add a
generators
dictionary prop to theMitosisConfig
:
mitosis/packages/core/src/types/config.ts
Line 19 in e862056
-
Update this call to take into account
options.generators
, by checking foroptions.generators[target]
before relying on the default generators:
mitosis/packages/cli/src/build/build.ts
Line 278 in e862056
I will do it