Config: {
    appDirectory?: string;
    basename?: string;
    buildDirectory?: string;
    buildEnd?: BuildEndHook;
    future?: [keyof FutureConfig] extends [never]
        ? {
            [key: string]: never;
        }
        : Partial<FutureConfig>;
    prerender?: boolean | string[] | ((args: {
        getStaticPaths: (() => string[]);
    }) => string[] | Promise<string[]>);
    presets?: Preset[];
    serverBuildFile?: string;
    serverBundles?: ServerBundlesFunction;
    serverModuleFormat?: ServerModuleFormat;
    ssr?: boolean;
}

Type declaration

  • OptionalappDirectory?: string

    The path to the app directory, relative to the root directory. Defaults to "app".

  • Optionalbasename?: string

    The React Router app basename. Defaults to "/".

  • OptionalbuildDirectory?: string

    The path to the build directory, relative to the project. Defaults to "build".

  • OptionalbuildEnd?: BuildEndHook

    A function that is called after the full React Router build is complete.

  • Optionalfuture?: [keyof FutureConfig] extends [never]
        ? {
            [key: string]: never;
        }
        : Partial<FutureConfig>

    Enabled future flags

  • Optionalprerender?: boolean | string[] | ((args: {
        getStaticPaths: (() => string[]);
    }) => string[] | Promise<string[]>)

    An array of URLs to prerender to HTML files at build time. Can also be a function returning an array to dynamically generate URLs.

  • Optionalpresets?: Preset[]

    An array of React Router plugin config presets to ease integration with other platforms and tools.

  • OptionalserverBuildFile?: string

    The file name of the server build output. This file should end in a .js extension and should be deployed to your server. Defaults to "index.js".

  • OptionalserverBundles?: ServerBundlesFunction

    A function for assigning routes to different server bundles. This function should return a server bundle ID which will be used as the bundle's directory name within the server build directory.

  • OptionalserverModuleFormat?: ServerModuleFormat

    The output format of the server build. Defaults to "esm".

  • Optionalssr?: boolean

    Enable server-side rendering for your application. Disable to use "SPA Mode", which will request the / path at build-time and save it as an index.html file with your assets so your application can be deployed as a SPA without server-rendering. Default's to true.