async function renderLess(code, { id, resolve, sourcemap }) {
	if (!less) {
		if (process.env.DISABLE_LESS !== 'true') {
			const mod = await import('less');
			less = mod.default || mod;
		}

		if (!less) {
			throw new Error(`Please install less to compile "*.less" files:\n    npm i -D less`);
		}
	}

	const lessOptions = {
		filename: id,
		plugins: [lessFileLoader(resolve, path.dirname(id))]
	};
	if (sourcemap) lessOptions.sourceMap = {};

	try {
		return await less.render(code, lessOptions);
	} catch (err) {
		if (err.extract && 'line' in err && 'column' in err) {
			const code = err.extract.filter(l => l !== undefined).join('\n');
			err.codeFrame = wmrCodeFrame(code, err.line - 1, err.column);
		}

		throw err;
	}
}
@param {string} code
@param {{id: string, resolve: any, sourcemap: boolean }} options
@returns {Promise<{ css: string, map?: string, imports: string[] }>}