I'm trying to make a vite plugin that takes already parsed svelte files and creates a "virtual module" (url: [file_name]?ssr_meta) for them, but I can't find a way to select the four named exports each page can have (ssr, hydrate, router and prerender) and remove any other exports/code that is not related to them.
Is there any way to do this besides manually walking through the AST?