async function do_build(options, analyse_code) {
	const { input, output, temp, extensions, alias, tsconfig } = normalize_options(options);

	if (!fs.existsSync(input)) {
		throw new Error(`${path.relative('.', input)} does not exist`);
	}

	rimraf(temp);
	mkdirp(temp);

	const files = scan(input, extensions);

	if (options.types) {
		await emit_dts(input, temp, output, options.cwd, alias, files, tsconfig);
	}

	for (const file of files) {
		await process_file(input, temp, file, options.config.preprocess, alias, tsconfig, analyse_code);
	}

	rimraf(output);
	mkdirp(output);
	copy(temp, output);

	console.log(
		colors
			.bold()
			.green(`${path.relative(options.cwd, input)} -> ${path.relative(options.cwd, output)}`)
	);
}
@param {import('./types.js').Options} options
@param {(name: string, code: string) => void} analyse_code