UNPKG

@aem-vite/vite-aem-plugin

Version:

A proxy server and starter kit for using Vite with Adobe Experience Manager.

51 lines (47 loc) 1.27 kB
import { PluginOption } from 'vite'; import { bundlesImportRewriter } from '@aem-vite/import-rewriter'; interface AemServerOptions { /** * Server host or ip address. * E.g. `localhost` or `0.0.0.0`. */ host: string; /** * Server port number. */ port: number; } interface PluginOptions { /** * AEM environment options. */ aem?: AemServerOptions; /** * Define a list of AEM paths that need to be proxied. */ aemProxySegments?: string[]; /** * The expression to use when matching ClientLibs on a page. * * @example * /etc.clienlibs/<project>/clientlibs/(<clientlib_one>|<clientlib_two>) */ clientlibsExpression?: string; /** * A list of AEM paths to watch and replace ClientLib paths within. */ contentPaths: string[]; /** * The public path in AEM where your ClientLibs are stored. * * @example * /etc.clienlibs/<project>/clientlibs/<clientlib> */ publicPath: string; /** * AEM Vite import rewriter options. */ rewriterOptions?: Omit<Parameters<typeof bundlesImportRewriter>[0], 'publicPath'>; } declare function viteForAem(options: PluginOptions): PluginOption[]; export { viteForAem };