function normalize_id(id, lib, cwd) {
	if (id.startsWith(lib)) {
		id = id.replace(lib, '$lib');
	}

	if (id.startsWith(cwd)) {
		id = path.relative(cwd, id);
	}

	if (id === app_server) {
		return '$app/server';
	}

	if (id === env_static_private) {
		return '$env/static/private';
	}

	if (id === env_static_public) {
		return '$env/static/public';
	}

	if (id === env_dynamic_private) {
		return '$env/dynamic/private';
	}

	if (id === env_dynamic_public) {
		return '$env/dynamic/public';
	}

	if (id === service_worker) {
		return '$service-worker';
	}

	return posixify(id);
}
Removes cwd/lib path from the start of the id
@param {string} id
@param {string} lib
@param {string} cwd