function resolveOptions(preResolveOptions, viteConfig, cache) {
	const css = preResolveOptions.emitCss ? 'external' : 'injected';
	/** @type {Partial<import('../public.d.ts').Options>} */
	const defaultOptions = {
		compilerOptions: {
			css,
			dev: !viteConfig.isProduction,
			hmr:
				!viteConfig.isProduction &&
				!preResolveOptions.isBuild &&
				viteConfig.server &&
				viteConfig.server.hmr !== false
		}
	};

	/** @type {Partial<import('../types/options.d.ts').ResolvedOptions>} */
	const extraOptions = {
		root: viteConfig.root,
		isProduction: viteConfig.isProduction
	};
	const merged = /** @type {import('../types/options.d.ts').ResolvedOptions}*/ (
		mergeConfigs(defaultOptions, preResolveOptions, extraOptions)
	);

	removeIgnoredOptions(merged);
	handleDeprecatedOptions(merged);
	addExtraPreprocessors(merged, viteConfig);
	enforceOptionsForHmr(merged, viteConfig);
	enforceOptionsForProduction(merged);
	// mergeConfigs would mangle functions on the stats class, so do this afterwards
	if (log.debug.enabled && isDebugNamespaceEnabled('stats')) {
		merged.stats = new VitePluginSvelteStats(cache);
	}
	return merged;
}
used in configResolved phase, merges a contextual default config, pre-resolved options, and some preprocessors. also validates the final config.

@param {import('../types/options.d.ts').PreResolvedOptions} preResolveOptions
@param {import('vite').ResolvedConfig} viteConfig
@param {import('./vite-plugin-svelte-cache.js').VitePluginSvelteCache} cache
@returns {import('../types/options.d.ts').ResolvedOptions}