extension-js / extension.js

🧩 Plug-and-play, zero-config, cross-browser extension development tool.
https://extension.js.org
MIT License
3.46k stars 80 forks source link

feat: support preact #75

Closed OSpoon closed 1 month ago

OSpoon commented 1 month ago

Hi~ I have added preact and preact-typescript template folders to programs/create/templates and made some necessary configuration changes. The only downside is that it might not be possible to use Functional Components. Other than that, the experience should be consistent with the react and react-typescript templates.

I will also continue to investigate the real reason why functional components cannot be used.

OSpoon commented 1 month ago

Hi @OSpoon! This is another great one! Comments left

Regarding the functional components: I managed to get the new tab page example running by enabling ReactRefreshPlugin. Maybe adding a Preact conditional in there might do the trick? Relevant file: main/programs/develop/webpack/plugins/reloadPlugins.ts#L19

Great, the functional components is indeed working properly.