Skip to content

Commit bec6c82

Browse files
authored
refactor(rsc): remove __fix_cloudflare plugin (#746)
1 parent 0a6cfdf commit bec6c82

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

packages/plugin-rsc/src/plugin.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,34 +2089,6 @@ function __vite_rsc_wrap_css__(value, name) {
20892089
}
20902090
}
20912091

2092-
/**
2093-
* temporary workaround for
2094-
* - https://github.com/cloudflare/workers-sdk/issues/9538 (fixed in @cloudflare/vite-plugin@1.8.0)
2095-
* - https://github.com/vitejs/vite/pull/20077 (fixed in vite@7.0.0)
2096-
*/
2097-
export function __fix_cloudflare(): Plugin {
2098-
return {
2099-
name: 'rsc:workaround-cloudflare',
2100-
enforce: 'post',
2101-
config(config) {
2102-
// https://github.com/cloudflare/workers-sdk/issues/9538
2103-
const plugin = config
2104-
.plugins!.flat()
2105-
.find((p) => p && 'name' in p && p.name === 'vite-plugin-cloudflare')
2106-
const original = (plugin as any).configResolved
2107-
;(plugin as any).configResolved = function (this: any, ...args: any[]) {
2108-
try {
2109-
return original.apply(this, args)
2110-
} catch (e) {}
2111-
}
2112-
2113-
// workaround (fixed in Vite 7) https://github.com/vitejs/vite/pull/20077
2114-
;(config.environments as any).ssr.resolve.noExternal = true
2115-
;(config.environments as any).rsc.resolve.noExternal = true
2116-
},
2117-
}
2118-
}
2119-
21202092
function sortObject<T extends object>(o: T) {
21212093
return Object.fromEntries(
21222094
Object.entries(o).sort(([a], [b]) => a.localeCompare(b)),

0 commit comments

Comments
 (0)