async function process_file(input, output, file, preprocessor, aliases, tsconfig, analyse_code) {
	const filename = path.join(input, file.name);
	const dest = path.join(output, file.dest);

	if (file.is_svelte || file.name.endsWith('.ts') || file.name.endsWith('.js')) {
		let contents = fs.readFileSync(filename, 'utf-8');

		if (file.is_svelte) {
			if (preprocessor) {
				const preprocessed = (await preprocess(contents, preprocessor, { filename })).code;
				contents = strip_lang_tags(preprocessed);
			}
		}

		if (file.name.endsWith('.ts') && !file.name.endsWith('.d.ts')) {
			contents = await transpile_ts(tsconfig, filename, contents);
		}

		contents = resolve_aliases(input, file.name, contents, aliases);
		analyse_code(file.name, contents);
		write(dest, contents);
	} else {
		copy(filename, dest);
	}
}
@param {string} input
@param {string} output
@param {import('./types.js').File} file
@param {import('svelte/types/compiler/preprocess').PreprocessorGroup | undefined} preprocessor
@param {Record<string, string>} aliases
@param {string | undefined} tsconfig
@param {(name: string, code: string) => void} analyse_code