function patchResolvedViteConfig(viteConfig, options) {
	if (options.preprocess) {
		for (const preprocessor of arraify(options.preprocess)) {
			if (preprocessor.style && '__resolvedConfig' in preprocessor.style) {
				preprocessor.style.__resolvedConfig = viteConfig;
			}
		}
	}
	if (rolldownVersion) {
		const plugins =
			// @ts-expect-error not typed
			viteConfig.optimizeDeps.rollupOptions?.plugins?.filter((p) =>
				[optimizeSveltePluginName, optimizeSvelteModulePluginName].includes(p.name)
			) ?? [];
		for (const plugin of plugins) {
			patchRolldownOptimizerPlugin(plugin, options);
		}
	} else {
		const plugins =
			viteConfig.optimizeDeps.esbuildOptions?.plugins?.filter((p) =>
				[optimizeSveltePluginName, optimizeSvelteModulePluginName].includes(p.name)
			) ?? [];
		for (const plugin of plugins) {
			patchESBuildOptimizerPlugin(plugin, options);
		}
	}
}
@param {import('vite').ResolvedConfig} viteConfig
@param {import('../types/options.d.ts').ResolvedOptions} options