async function unpkgResolve(id) {
	let [, name, path = ''] = id.match(/^((?:@[^@/?]+\/)?[^@/?]+)(?:@[^/?]+)?(?:\/([^?]+))?(?:\?.*)?$/) || [];
	const info = await getPackageInfo(name);

	if (!info.exports && EXPORTMAPS.hasOwnProperty(name)) {
		info.exports = EXPORTMAPS[name];
	}

	if (info.exports) {
		// export maps
		const exp = ('./' + path.replace(/^\.?\//, '')).replace(/\/$/g, '');
		const entry = info.exports[exp];
		if (entry) {
			let p = (typeof entry === 'string' && entry) || entry.browser || entry.module || entry.umd || entry.default;
			if (!p) throw `Invalid Export Map entry for ${exp}`;
			path = p.replace(/^\.?\/?/g, '');
		} else if (!info.exports['./']) {
			throw `No matching Export Map entry for ${exp}.`;
		}
	} else {
		// bare imports route through package entry fields:
		if (!path) {
			path = info.esmodules || info.module || info['jsnext:main'] || info.browser || info.main;
		}

		if (!path.match(/\.([mc]js|[tj]sx?)$/g)) path += '.js';

		// if (!path) {
		// 	console.log('falling back to ?module lookup for ', id);
		// 	path += '?module';
		// }
	}

	return name + (path ? `/${path}` : '');
}
Resolve a specifier using package metadata fetched from unpkg
@param {string} id