function markdownRollupPlugin({ root, prod, ...opts }) {
	return {
		name: 'markdown',
		async resolveId(id, importer) {
			if (id[0] === '\0') return;
			if (id.startsWith('markdown:')) id = id.slice(9);
			else if (!id.endsWith('.md')) return;
			if (importer) importer = importer.replace(/^[\0\b]\w+:/g, '');
			return `\0markdown:${path.join(path.dirname(importer), id)}`;
		},
		async load(id) {
			if (!id.startsWith('\0markdown:')) return;
			id = path.resolve(root || '.', id.slice(10));
			this.addWatchFile(id);

			const fileId = this.emitFile({
				type: 'asset',
				name: path.relative(root || '.', id),
				fileName: path.relative(root || '.', id),
				source: await processMarkdown(id, opts)
			});
			return `export default import.meta.ROLLUP_FILE_URL_${fileId}`;
		}
	};
}
markdown plugin for Rollup / WMR
 @example import html from 'markdown:./pages';