I'm building two web applications in svelte/typescript:
- Site A that works as the public-facing front that needs to be as fast and lean as possible
- Site B that is the administration UI where editors update the content that is presented in Site A
I want to use the same "view component" (from Site A) in the editor (in Site B) but attach some editor logic in order to build a WYSIWYG experience without code duplication.
I could of course just make both Site A and Site B be part of the same svelte application but I don't want the visitors of Site A to load all the modules and code used in Site B.
How should I design this to avoid code duplication but still prevent logic from Site B from leaking into Site A?