@storybook/preact
Version:
Storybook Preact renderer: Develop, document, and test UI components in isolation
35 lines (31 loc) • 1.29 kB
JavaScript
import CJS_COMPAT_NODE_URL_9nwd4my1d9g from 'node:url';
import CJS_COMPAT_NODE_PATH_9nwd4my1d9g from 'node:path';
import CJS_COMPAT_NODE_MODULE_9nwd4my1d9g from "node:module";
var __filename = CJS_COMPAT_NODE_URL_9nwd4my1d9g.fileURLToPath(import.meta.url);
var __dirname = CJS_COMPAT_NODE_PATH_9nwd4my1d9g.dirname(__filename);
var require = CJS_COMPAT_NODE_MODULE_9nwd4my1d9g.createRequire(import.meta.url);
// ------------------------------------------------------------
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
// ------------------------------------------------------------
// src/preset.ts
import { fileURLToPath } from "node:url";
var previewAnnotations = async (input = [], options) => {
let docsEnabled = Object.keys(await options.presets.apply("docs", {}, options)).length > 0;
return [].concat(input).concat([fileURLToPath(import.meta.resolve("@storybook/preact/entry-preview"))]).concat(
docsEnabled ? [fileURLToPath(import.meta.resolve("@storybook/preact/entry-preview-docs"))] : []
);
}, resolvedReact = async (existing) => {
try {
return {
...existing,
react: "preact/compat",
reactDom: "preact/compat"
};
} catch {
return existing;
}
};
export {
previewAnnotations,
resolvedReact
};