function loader(value, bindings, callback) {
  const defaults = this.sourceMap ? { SourceMapGenerator } : {}
  const options = this.getOptions()
  const config = { ...defaults, ...options }
  const hash = getOptionsHash(options)
  const compiler = this._compiler || marker

  let map = cache.get(compiler)

  if (!map) {
    map = new Map()
    cache.set(compiler, map)
  }

  let process = map.get(hash)

  if (!process) {
    process = createFormatAwareProcessors(
      bindings,
      coereceMdxTransformOptions(config)
    ).compile
    map.set(hash, process)
  }

  process({ value, path: this.resourcePath }).then(
    (code) => {
      // TODO: no sourcemap
      callback(null, code, null)
    },
    (error) => {
      const fpath = path.relative(this.context, this.resourcePath)
      error.message = `${fpath}:${error.name}: ${error.message}`
      callback(error)
    }
  )
}
A webpack loader for mdx-rs. This is largely based on existing @mdx-js/loader,
replaces internal compilation logic to use mdx-rs instead.