@stencil/react-output-target
Version:
React output target for @stencil/core components.
51 lines (50 loc) • 2.14 kB
TypeScript
import type { OutputTargetCustom } from '@stencil/core/internal';
export interface ReactOutputTargetOptions {
/**
* Specify the output directory or path where the generated React components will be saved.
*/
outDir: string;
/**
* Specify the components that should be excluded from the React output target.
*/
excludeComponents?: string[];
/**
* The package name of the Stencil project.
*
* This value is automatically detected from the package.json file of the Stencil project.
* If the validation fails, you can manually assign the package name.
*/
stencilPackageName?: string;
/**
* Enables generating the react components as ES modules.
* @default false
*/
esModules?: boolean;
/**
* The directory where the custom elements are saved.
*
* This value is automatically detected from the Stencil configuration file for the dist-custom-elements output target.
* If you are working in an environment that uses absolute paths, consider setting this value manually.
*/
customElementsDir?: string;
/**
* To enable server side rendering, provide the path to the hydrate module, e.g. `my-component/hydrate`.
* By default this value is undefined and server side rendering is disabled.
*/
hydrateModule?: string;
/**
* Specify the components that should be excluded from server side rendering.
*/
excludeServerSideRenderingFor?: string[];
}
interface ReactOutputTarget extends OutputTargetCustom {
__internal_getCustomElementsDir: () => string;
}
/**
* Creates an output target for binding Stencil components to be used in a React context
* @public
* @param outputTarget the user-defined output target defined in a Stencil configuration file
* @returns an output target that can be used by the Stencil compiler
*/
export declare const reactOutputTarget: ({ outDir, esModules, stencilPackageName, excludeComponents, customElementsDir: customElementsDirOverride, hydrateModule, excludeServerSideRenderingFor, }: ReactOutputTargetOptions) => ReactOutputTarget;
export {};