Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite: Cloudflare Proxy plugin #8749

Merged
merged 24 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
automatically set ssr resolve conditions for workerd
  • Loading branch information
pcattori committed Feb 13, 2024
commit afcf009718cbe438dd8c626257e5075839f61650
5 changes: 0 additions & 5 deletions integration/vite-cloudflare-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ const files: Files = async ({ port }) => ({

export default {
${await viteConfig.server({ port })}
ssr: {
resolve: {
externalConditions: ["workerd", "worker"],
},
},
plugins: [
remixCloudflareProxy({ getLoadContext }),
remix(),
Expand Down
7 changes: 7 additions & 0 deletions packages/remix-dev/vite/cloudflare-proxy-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ export const cloudflareProxyVitePlugin = <
): Plugin => {
return {
name: "vite-plugin-remix-cloudflare-proxy",
config: () => ({
ssr: {
resolve: {
externalConditions: ["workerd", "worker"],
},
},
}),
async configureServer(viteDevServer) {
let cloudflare = await getPlatformProxy<E, Cf>();
let context = { cloudflare };
Expand Down
Loading