Files
WRNexusJS/packages/image/src/plugin.ts
T
Clintchiz 586a6db8ff
Quality / quality (ubuntu-latest) (push) Failing after 21s
Quality / quality (windows-latest) (push) Canceled after 0s
release: WRNexusJS 0.8.0
2026-08-02 23:18:51 +05:30

21 lines
666 B
TypeScript

import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { definePlugin } from "@wrnexus/plugin";
export interface ImagePluginOptions {
components?: boolean;
componentDir?: string;
}
const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
export function imageComponentsDir(): string {
return join(packageRoot, "components");
}
export function imagePlugin(options: ImagePluginOptions = {}) {
return definePlugin({
name: "@wrnexus/image",
version: "0.8.0",
componentDirs:
options.components === false ? [] : [options.componentDir ?? imageComponentsDir()],
});
}
export default imagePlugin;