module-federation / vite

Vite Plugin for Module Federation
MIT License
169 stars 5 forks source link

The Svelte example is 404 #26

Open Mooncat25 opened 2 weeks ago

Mooncat25 commented 2 weeks ago

The Svelte example was there a week ago but is now 404. Does it mean Vite + Svelte is actually not supported?

I could recreate the original example with no problem. But when I use a Svelte component library in the remote app, it fails to build.

Related discussion: https://github.com/module-federation/module-federation-examples/discussions/4049

I think the problem is Svelte allows exporting components without compiling them into Javascript, i.e. they remain as .svelte files, and Vite and ESBuild do not know how to handle them. Unfortunately, my knowledge in this area is very limited. The only thing I can do is to try different config options and plugin orders. Now seeing the official example is 404, I think I have to consider giving up and going back to React.

KaiVolland commented 1 week ago

It was removed here: https://github.com/module-federation/module-federation-examples/pull/4086. Maybe this helps.

Mooncat25 commented 1 week ago

It was removed here: module-federation/module-federation-examples#4086. Maybe this helps.

Thanks. I will subscribe that thread. Tbh at this point I have given up implementing Module Federation in my Vite+Svelte project. I'm studying Vite/Rollup's options and hooks for accomplishing micro-frontends with shareable chunks. Though Vite currently has a bug that complicates things.