rwsdk 0.1.0-alpha.6 → 0.1.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vite/configPlugin.mjs +28 -2
- package/package.json +1 -1
|
@@ -61,7 +61,20 @@ export const configPlugin = ({ mode, silent, projectRootDir, clientEntryPathname
|
|
|
61
61
|
},
|
|
62
62
|
ssr: {
|
|
63
63
|
resolve: {
|
|
64
|
-
conditions: [
|
|
64
|
+
conditions: [
|
|
65
|
+
"workerd",
|
|
66
|
+
// context(justinvdm, 11 Jun 2025): Some packages meant for cloudflare workers, yet
|
|
67
|
+
// their deps have only node import conditions, e.g. `agents` package (meant for CF),
|
|
68
|
+
// has `pkce-challenge` package as a dep, which has only node import conditions.
|
|
69
|
+
// https://github.com/crouchcd/pkce-challenge/blob/master/package.json#L17
|
|
70
|
+
//
|
|
71
|
+
// Once the transformed code for this environment is in turn processed in the `worker` environment,
|
|
72
|
+
// @cloudflare/vite-plugin should take care of any relevant polyfills for deps with
|
|
73
|
+
// node builtins imports that can be polyfilled though, so it is worth us including this condition here.
|
|
74
|
+
// However, it does mean we will try to run packages meant for node that cannot be run on cloudflare workers.
|
|
75
|
+
// That's the trade-off, but arguably worth it. (context(justinvdm, 11 Jun 2025))
|
|
76
|
+
"node",
|
|
77
|
+
],
|
|
65
78
|
noExternal: true,
|
|
66
79
|
},
|
|
67
80
|
define: {
|
|
@@ -92,7 +105,20 @@ export const configPlugin = ({ mode, silent, projectRootDir, clientEntryPathname
|
|
|
92
105
|
},
|
|
93
106
|
worker: {
|
|
94
107
|
resolve: {
|
|
95
|
-
conditions: [
|
|
108
|
+
conditions: [
|
|
109
|
+
"workerd",
|
|
110
|
+
"react-server",
|
|
111
|
+
// context(justinvdm, 11 Jun 2025): Some packages meant for cloudflare workers, yet
|
|
112
|
+
// their deps have only node import conditions, e.g. `agents` package (meant for CF),
|
|
113
|
+
// has `pkce-challenge` package as a dep, which has only node import conditions.
|
|
114
|
+
// https://github.com/crouchcd/pkce-challenge/blob/master/package.json#L17
|
|
115
|
+
//
|
|
116
|
+
// @cloudflare/vite-plugin should take care of any relevant polyfills for deps with
|
|
117
|
+
// node builtins imports that can be polyfilled though, so it is worth us including this condition here.
|
|
118
|
+
// However, it does mean we will try to run packages meant for node that cannot be run on cloudflare workers.
|
|
119
|
+
// That's the trade-off, but arguably worth it.
|
|
120
|
+
"node",
|
|
121
|
+
],
|
|
96
122
|
noExternal: true,
|
|
97
123
|
},
|
|
98
124
|
define: {
|