function toESBuildError(error, options) {
	const { filename, frame, start, stack } = error;
	/** @type any */
	const partialMessage = {
		text: buildExtendedLogMessage(error)
	};
	if (start) {
		partialMessage.location = {
			line: start.line,
			column: start.column,
			file: filename,
			lineText: lineFromFrame(start.line, frame) // needed to get a meaningful error message on cli
		};
	}
	if (options.isBuild || options.isDebug || !frame) {
		partialMessage.detail = stack;
	}
	return partialMessage;
}
convert an error thrown by svelte.compile to an esbuild PartialMessage
@param {import('svelte/compiler').Warning & Error  & {frame?: string}} error a svelte compiler error, which is a mix of Warning and an error
@param {import('../types/options.d.ts').ResolvedOptions} options
@returns {any} the converted error as esbuild PartialMessage

note: typed any to avoid esbuild devDependency for a single internal type import