import { pathToFileURL } from 'node:url' import type { Component } from '@nuxt/schema' import { parseURL } from 'ufo' import { createUnplugin } from 'unplugin' import MagicString from 'magic-string' import { ELEMENT_NODE, parse, walk } from 'ultrahtml' import { isVue } from '../core/utils' interface ServerOnlyComponentTransformPluginOptions { getComponents: () => Component[] } const SCRIPT_RE = /]*>/g const HAS_SLOT_RE = /]*>/ const TEMPLATE_RE = /