async transform(code, id) {
			/** @type {import('./sourcemap.js').SourceMap[]} */
			const sourceMaps = [];

			for (plugin of plugins) {
				if (!plugin.transform) continue;
				const result = await plugin.transform.call(ctx, code, id);
				if (!result) continue;

				logTransform(`${kl.dim(formatPath(id))} [${plugin.name}]`);
				if (typeof result === 'object') {
					if (result.map) {
						// Normalize source map sources URLs for the browser
						result.map.sources = result.map.sources.map(s => {
							if (typeof s === 'string') {
								return `/${posix.normalize(s)}`;
							} else if (hasDebugFlag()) {
								logTransform(kl.yellow(`Invalid source map returned by plugin `) + kl.magenta(plugin.name));
							}

							return s;
						});

						sourceMaps.push(result.map);
					} else if (opts.sourcemap && result.code !== code) {
						logTransform(kl.yellow(`Missing sourcemap result in transform() method of `) + kl.magenta(plugin.name));
					}

					code = result.code;
				} else {
					if (opts.sourcemap && code !== result) {
						logTransform(kl.yellow(`Missing sourcemap result in transform() method of `) + kl.magenta(plugin.name));
					}
					code = result;
				}
			}
			return { code, map: sourceMaps.length ? mergeSourceMaps(sourceMaps) : null };
		}
@param {string} code
@param {string} id