function transform_module(analysis, source, options) {
	if (options.generate === false) {
		return {
			js: /** @type {any} */ (null),
			css: null,
			warnings: state.warnings, // set afterwards
			metadata: {
				runes: true
			},
			ast: /** @type {any} */ (null) // set afterwards
		};
	}

	const program =
		options.generate === 'server'
			? server_module(analysis, options)
			: client_module(analysis, options);

	const basename = options.filename.split(/[/\\]/).at(-1);
	if (program.body.length > 0) {
		program.body[0].leadingComments = [
			{
				type: 'Block',
				value: ` ${basename} generated by Svelte v${VERSION} `
			}
		];
	}

	return {
		js: print(program, {
			// include source content; makes it easier/more robust looking up the source map code
			// (else esrap does return null for source and sourceMapContent which may trip up tooling)
			sourceMapContent: source,
			sourceMapSource: get_source_name(options.filename, undefined, 'input.svelte.js')
		}),
		css: null,
		metadata: {
			runes: true
		},
		warnings: state.warnings, // set afterwards
		ast: /** @type {any} */ (null) // set afterwards
	};
}
@param {Analysis} analysis
@param {string} source
@param {ValidatedModuleCompileOptions} options
@returns {CompileResult}