function writeResolvedConfig() {
	let cmd;
	return {
		name: 'writeResolvedConfig',
		enforce: 'post',
		config(_, { command }) {
			cmd = command;
		},
		configResolved(config) {
			function replacer(key, value) {
				if (value instanceof RegExp) return value.toString();
				else return value;
			}
			const serializableConfig = {
				...config,
				plugins: config.plugins.map((p) => p.name)
			};
			const dir = path.join(config.root, 'logs', 'resolved-configs');
			if (!fs.existsSync(dir)) {
				fs.mkdirSync(dir, { recursive: true });
			}
			const filename = path.join(dir, `vite.config.${cmd}${config.build.ssr ? '.ssr' : ''}.json`);
			fs.writeFileSync(filename, JSON.stringify(serializableConfig, replacer, '\t'), 'utf-8');
		}
	};
}
write resolved config
@returns {import('vite').Plugin}