function inlinePlugin(contents) {
  return {
    name: 'inline plugin',
    setup(build) {
      build.onResolve({filter: /esbuild\.mdx/}, function () {
        return {
          path: fileURLToPath(new URL('esbuild.mdx', import.meta.url)),
          pluginData: {contents}
        }
      })
    }
  }
}
@param {string} contents
  Contents.
@returns {Plugin}
  Plugin.