async function onload(data) {
      const document = String(
        data.pluginData &&
          data.pluginData.contents !== null &&
          data.pluginData.contents !== undefined
          ? data.pluginData.contents
          : await fs.readFile(data.path)
      )

      /** @type {State} */
      const state = {doc: document, name, path: data.path}
      let file = new VFile({path: data.path, value: document})
      /** @type {string | undefined} */
      let value
      /** @type {Array<VFileMessage>} */
      let messages = []
      /** @type {Array<Message>} */
      const errors = []
      /** @type {Array<Message>} */
      const warnings = []

      try {
        file = await process(file)
        value =
          String(file.value) +
          '\n//# sourceMappingURL=data:application/json;base64,' +
          Buffer.from(JSON.stringify(file.map)).toString('base64') +
          '\n'
        messages = file.messages
      } catch (error_) {
        const cause = /** @type {VFileMessage | Error} */ (error_)
        const message = new VFileMessage(
          'Cannot process MDX file with esbuild',
          {
            cause,
            place: 'reason' in cause ? cause.place : undefined,
            ruleId: 'process-error',
            source: '@mdx-js/esbuild'
          }
        )
        message.fatal = true
        messages.push(message)
      }

      for (const message of messages) {
        const list = message.fatal ? errors : warnings
        list.push(vfileMessageToEsbuild(state, message))
      }

      // Safety check: the file has a path, so there has to be a `dirname`.
      assert(file.dirname, 'expected `dirname` to be defined')

      return {
        contents: value || '',
        errors,
        loader: settings.jsx ? 'jsx' : 'js',
        resolveDir: path.resolve(file.cwd, file.dirname),
        warnings
      }
    }
@param {LoadData} data
  Data.
@returns {Promise<OnLoadResult>}
  Result.