Skip to content

Commit

Permalink
replace vite plugin config w/ react-router.config.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed Nov 22, 2024
1 parent 4fa0d2d commit 6ba3738
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,29 +329,26 @@ For Remix consumers migrating to React Router, the `vitePlugin` and `cloudflareD
+import { cloudflareDevProxy } from "@react-router/dev/vite/cloudflare";
```

**Removed Vite Plugin `manifest` option**
**Removed `manifest` option**

For Remix consumers migrating to React Router, the Vite plugin's `manifest` option has been removed. The `manifest` option been superseded by the more powerful `buildEnd` hook since it's passed the `buildManifest` argument. You can still write the build manifest to disk if needed, but you'll most likely find it more convenient to write any logic depending on the build manifest within the `buildEnd` hook itself. ([#11573](https://github.com/remix-run/react-router/pull/11573))

If you were using the `manifest` option, you can replace it with a `buildEnd` hook that writes the manifest to disk like this:

```js
import { reactRouter } from "@react-router/dev/vite";
// react-router.config.ts
import { type Config } from "@react-router/dev/config";
import { writeFile } from "node:fs/promises";

export default {
plugins: [
reactRouter({
async buildEnd({ buildManifest }) {
await writeFile(
"build/manifest.json",
JSON.stringify(buildManifest, null, 2),
"utf-8"
);
},
}),
],
};
async buildEnd({ buildManifest }) {
await writeFile(
"build/manifest.json",
JSON.stringify(buildManifest, null, 2),
"utf-8"
);
},
} satisfies Config;
```

#### Exposed Router Promises
Expand Down

0 comments on commit 6ba3738

Please sign in to comment.