@vercel/microfrontends
Version:
Defines configuration and utilities for microfrontends development
31 lines (28 loc) • 1.12 kB
TypeScript
import { Plugin } from 'vite';
interface MicrofrontendsViteOptions {
/**
* An optional base path to use instead of an asset prefix. This will prefix
* _all_ paths in an application with the provided string. This can be used
* when it is okay if every path has a common path prefix. If an application
* has URLs that don't share a common path prefix, omit this option.
*
* See https://vite.dev/guide/build#public-base-path for more information.
*/
basePath?: string;
}
/**
* Set up Vite with necessary configuration for microfrontends. This should be
* used with any framework that uses Vite as the bundler.
*
* See the [Getting Started](https://vercel.com/docs/microfrontends/quickstart) guide for more information.
*
* @example Setting up Vite with microfrontends
* ```ts filename="vite.config.ts"
* import { microfrontends } from '@vercel/microfrontends/experimental/vite';
* export default defineConfig({
* plugins: [microfrontends()],
* });
* ```
*/
declare function microfrontends(opts?: MicrofrontendsViteOptions): Plugin;
export { microfrontends };