Skip to content

Commit

Permalink
Move Cloudflare proxy to dev/vite/cloudflare (#11906)
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish authored Aug 20, 2024
1 parent 3f523e5 commit 46b3cfc
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
8 changes: 3 additions & 5 deletions .changeset/angry-papayas-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
"@react-router/dev": major
---

For Remix consumers migrating to React Router, the `vitePlugin` and `cloudflareDevProxyVitePlugin` exports have been renamed and nested under `@react-router/dev/vite` to remove the `vitePlugin` naming convention .
For Remix consumers migrating to React Router, the `vitePlugin` and `cloudflareDevProxyVitePlugin` exports have been renamed and moved.

```diff
-import {
- vitePlugin as remix,
- cloudflareDevProxyVitePlugin,
-} from "@remix/dev";

+import {
+ reactRouter,
+ cloudflareDevProxy,
+} from "@react-router/dev/vite";
+import { reactRouter } from "@react-router/dev/vite";
+import { cloudflareDevProxy } from "@react-router/dev/vite/cloudflare";
```
3 changes: 2 additions & 1 deletion integration/helpers/vite-cloudflare-template/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { reactRouter, cloudflareDevProxy } from "@react-router/dev/vite";
import { reactRouter } from "@react-router/dev/vite";
import { cloudflareDevProxy } from "@react-router/dev/vite/cloudflare";
import { defineConfig } from "vite";

export default defineConfig({
Expand Down
6 changes: 2 additions & 4 deletions integration/vite-cloudflare-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import { test, viteConfig } from "./helpers/vite.js";

const files: Files = async ({ port }) => ({
"vite.config.ts": `
import {
reactRouter,
cloudflareDevProxy,
} from "@react-router/dev/vite";
import { reactRouter } from "@react-router/dev/vite";
import { cloudflareDevProxy } from "@react-router/dev/vite/cloudflare";
import { getLoadContext } from "./load-context";
export default {
Expand Down
4 changes: 4 additions & 0 deletions packages/react-router-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
"types": "./dist/vite.d.ts",
"default": "./dist/vite.js"
},
"./vite/cloudflare": {
"types": "./dist/vite-cloudflare.d.ts",
"default": "./dist/vite-cloudflare.js"
},
"./package.json": "./package.json"
},
"bin": {
Expand Down
1 change: 1 addition & 0 deletions packages/react-router-dev/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = function rollup() {
`${SOURCE_DIR}/index.ts`,
`${SOURCE_DIR}/routes.ts`,
`${SOURCE_DIR}/vite.ts`,
`${SOURCE_DIR}/vite-cloudflare.ts`,
],
output: {
banner: createBanner("@react-router/dev", version),
Expand Down
1 change: 1 addition & 0 deletions packages/react-router-dev/vite-cloudflare.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { cloudflareDevProxyVitePlugin as cloudflareDevProxy } from "./vite/cloudflare-dev-proxy";
1 change: 0 additions & 1 deletion packages/react-router-dev/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ export type {
} from "./vite/config";

export { reactRouterVitePlugin as reactRouter } from "./vite/plugin";
export { cloudflareDevProxyVitePlugin as cloudflareDevProxy } from "./vite/cloudflare-dev-proxy";

0 comments on commit 46b3cfc

Please sign in to comment.