message: fix(md-enhance): fix legacy mode for md-enhance
diff: +import { createRequire } from "node:module";
  import { CLIENT_FOLDER } from "../utils.js";
  import type { App } from "@vuepress/core";
  import type { MarkdownEnhanceOptions } from "../options.js";
  +const require = createRequire(import.meta.url);
  +
  export const prepareConfigFile = async (
  app: App,
  options: MarkdownEnhanceOptions,
  @@ -36,10 +39,15 @@ app.component("CodeTabs", CodeTabs);
  // TODO: Remove this in v2 stable
  if (legacy) {
  configImport += `\
  +import { hasGlobalComponent } from "${require.resolve(
  + "vuepress-shared/client"
  + )}";
  import { CodeGroup, CodeGroupItem } from "${CLIENT_FOLDER}compact/index.js";
  `;
  enhance += `\
  +if(!hasGlobalComponent("CodeGroup", app))
  app.component("CodeGroup", CodeGroup);
  +if(!hasGlobalComponent("CodeGroupItem", app))
  app.component("CodeGroupItem", CodeGroupItem);
  `;
  }
  