import type { Preset } from "@react-router/dev/config";
export function myPreset(): Preset {
return {
name: "my-preset",
async reactRouterConfig({ reactRouterUserConfig }) {
// Return config overrides
return {
serverModuleFormat: "esm",
buildDirectory: "dist",
async buildEnd({ buildManifest, reactRouterConfig, viteConfig }) {
// Run after build completes
console.log("Build finished!");
// Deploy, generate files, etc.
await deployToMyPlatform(buildManifest);
},
};
},
async reactRouterConfigResolved({ reactRouterConfig }) {
// Called after all config is resolved
console.log("Config resolved:", reactRouterConfig);
},
};
}