vue-schema-org-integrations
Version:
Helper installs functions for frameworks. Currently, supporting Vite, VitePress and Vitesse.
23 lines (20 loc) • 598 B
JavaScript
import { schemaOrgComponents } from 'vue-schema-org';
export { schemaOrgAutoImports, schemaOrgComponents } from 'vue-schema-org';
function SchemaOrgResolver(options = {}) {
const { prefix = "" } = options;
return {
type: "component",
resolve: (name) => {
if (name.startsWith(prefix)) {
const componentName = name.substring(prefix.length);
if (schemaOrgComponents.includes(componentName)) {
return {
name: componentName,
from: "vue-schema-org/components"
};
}
}
}
};
}
export { SchemaOrgResolver };