@payloadcms/tanstack-start 4.0.0-canary.8

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.
Files changed (216) hide show
  1. package/LICENSE.md +22 -0
  2. package/dist/auth/login.d.ts +17 -0
  3. package/dist/auth/login.d.ts.map +1 -0
  4. package/dist/auth/login.js +50 -0
  5. package/dist/auth/login.js.map +1 -0
  6. package/dist/auth/logout.d.ts +9 -0
  7. package/dist/auth/logout.d.ts.map +1 -0
  8. package/dist/auth/logout.js +51 -0
  9. package/dist/auth/logout.js.map +1 -0
  10. package/dist/auth/refresh.d.ts +8 -0
  11. package/dist/auth/refresh.d.ts.map +1 -0
  12. package/dist/auth/refresh.js +53 -0
  13. package/dist/auth/refresh.js.map +1 -0
  14. package/dist/elements/DocumentHeaderClient/index.d.ts +16 -0
  15. package/dist/elements/DocumentHeaderClient/index.d.ts.map +1 -0
  16. package/dist/elements/DocumentHeaderClient/index.js +116 -0
  17. package/dist/elements/DocumentHeaderClient/index.js.map +1 -0
  18. package/dist/elements/RenderComponent/index.d.ts +10 -0
  19. package/dist/elements/RenderComponent/index.d.ts.map +1 -0
  20. package/dist/elements/RenderComponent/index.js +12 -0
  21. package/dist/elements/RenderComponent/index.js.map +1 -0
  22. package/dist/elements/RouterAdapter/index.d.ts +3 -0
  23. package/dist/elements/RouterAdapter/index.d.ts.map +1 -0
  24. package/dist/elements/RouterAdapter/index.js +141 -0
  25. package/dist/elements/RouterAdapter/index.js.map +1 -0
  26. package/dist/exports/client.d.ts +8 -0
  27. package/dist/exports/client.d.ts.map +1 -0
  28. package/dist/exports/client.js +10 -0
  29. package/dist/exports/client.js.map +1 -0
  30. package/dist/exports/layouts.d.ts +6 -0
  31. package/dist/exports/layouts.d.ts.map +1 -0
  32. package/dist/exports/layouts.js +5 -0
  33. package/dist/exports/layouts.js.map +1 -0
  34. package/dist/exports/rsc.browser.d.ts +12 -0
  35. package/dist/exports/rsc.browser.d.ts.map +1 -0
  36. package/dist/exports/rsc.browser.js +12 -0
  37. package/dist/exports/rsc.browser.js.map +1 -0
  38. package/dist/exports/rsc.d.ts +5 -0
  39. package/dist/exports/rsc.d.ts.map +1 -0
  40. package/dist/exports/rsc.js +6 -0
  41. package/dist/exports/rsc.js.map +1 -0
  42. package/dist/exports/server.d.ts +17 -0
  43. package/dist/exports/server.d.ts.map +1 -0
  44. package/dist/exports/server.js +18 -0
  45. package/dist/exports/server.js.map +1 -0
  46. package/dist/exports/vite.d.ts +3 -0
  47. package/dist/exports/vite.d.ts.map +1 -0
  48. package/dist/exports/vite.js +3 -0
  49. package/dist/exports/vite.js.map +1 -0
  50. package/dist/index.d.ts +6 -0
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +7 -0
  53. package/dist/index.js.map +1 -0
  54. package/dist/layouts/Root/getLayoutData.d.ts +12 -0
  55. package/dist/layouts/Root/getLayoutData.d.ts.map +1 -0
  56. package/dist/layouts/Root/getLayoutData.js +91 -0
  57. package/dist/layouts/Root/getLayoutData.js.map +1 -0
  58. package/dist/layouts/Root/index.d.ts +32 -0
  59. package/dist/layouts/Root/index.d.ts.map +1 -0
  60. package/dist/layouts/Root/index.js +51 -0
  61. package/dist/layouts/Root/index.js.map +1 -0
  62. package/dist/layouts/Root/withPayloadRoot.d.ts +65 -0
  63. package/dist/layouts/Root/withPayloadRoot.d.ts.map +1 -0
  64. package/dist/layouts/Root/withPayloadRoot.js +92 -0
  65. package/dist/layouts/Root/withPayloadRoot.js.map +1 -0
  66. package/dist/node/cssLoader.d.mts +3 -0
  67. package/dist/node/cssLoader.d.mts.map +1 -0
  68. package/dist/node/cssLoader.js +70 -0
  69. package/dist/node/cssLoader.js.map +1 -0
  70. package/dist/node/cssLoader.mjs +75 -0
  71. package/dist/node/registerCssLoader.d.mts +2 -0
  72. package/dist/node/registerCssLoader.d.mts.map +1 -0
  73. package/dist/node/registerCssLoader.js +10 -0
  74. package/dist/node/registerCssLoader.js.map +1 -0
  75. package/dist/node/registerCssLoader.mjs +10 -0
  76. package/dist/routes/adminRoutes.d.ts +111 -0
  77. package/dist/routes/adminRoutes.d.ts.map +1 -0
  78. package/dist/routes/adminRoutes.js +108 -0
  79. package/dist/routes/adminRoutes.js.map +1 -0
  80. package/dist/routes/apiRoute.d.ts +29 -0
  81. package/dist/routes/apiRoute.d.ts.map +1 -0
  82. package/dist/routes/apiRoute.js +38 -0
  83. package/dist/routes/apiRoute.js.map +1 -0
  84. package/dist/routes/layoutRoute.d.ts +26 -0
  85. package/dist/routes/layoutRoute.d.ts.map +1 -0
  86. package/dist/routes/layoutRoute.js +57 -0
  87. package/dist/routes/layoutRoute.js.map +1 -0
  88. package/dist/rsc/CollectionCards.d.ts +4 -0
  89. package/dist/rsc/CollectionCards.d.ts.map +1 -0
  90. package/dist/rsc/CollectionCards.js +12 -0
  91. package/dist/rsc/CollectionCards.js.map +1 -0
  92. package/dist/rsc/HierarchyTypeFieldServer.d.ts +9 -0
  93. package/dist/rsc/HierarchyTypeFieldServer.d.ts.map +1 -0
  94. package/dist/rsc/HierarchyTypeFieldServer.js +35 -0
  95. package/dist/rsc/HierarchyTypeFieldServer.js.map +1 -0
  96. package/dist/rsc/renderOnDemand.d.ts +15 -0
  97. package/dist/rsc/renderOnDemand.d.ts.map +1 -0
  98. package/dist/rsc/renderOnDemand.js +25 -0
  99. package/dist/rsc/renderOnDemand.js.map +1 -0
  100. package/dist/rsc/renderPayloadRSC.d.ts +6 -0
  101. package/dist/rsc/renderPayloadRSC.d.ts.map +1 -0
  102. package/dist/rsc/renderPayloadRSC.js +6 -0
  103. package/dist/rsc/renderPayloadRSC.js.map +1 -0
  104. package/dist/utilities/devReloadStrategy.d.ts +10 -0
  105. package/dist/utilities/devReloadStrategy.d.ts.map +1 -0
  106. package/dist/utilities/devReloadStrategy.js +27 -0
  107. package/dist/utilities/devReloadStrategy.js.map +1 -0
  108. package/dist/utilities/getExistingAuthToken.d.ts +7 -0
  109. package/dist/utilities/getExistingAuthToken.d.ts.map +1 -0
  110. package/dist/utilities/getExistingAuthToken.js +18 -0
  111. package/dist/utilities/getExistingAuthToken.js.map +1 -0
  112. package/dist/utilities/getPreferences.d.ts +10 -0
  113. package/dist/utilities/getPreferences.d.ts.map +1 -0
  114. package/dist/utilities/getPreferences.js +33 -0
  115. package/dist/utilities/getPreferences.js.map +1 -0
  116. package/dist/utilities/getRequestI18n.server.d.ts +12 -0
  117. package/dist/utilities/getRequestI18n.server.d.ts.map +1 -0
  118. package/dist/utilities/getRequestI18n.server.js +25 -0
  119. package/dist/utilities/getRequestI18n.server.js.map +1 -0
  120. package/dist/utilities/getRequestLocale.d.ts +7 -0
  121. package/dist/utilities/getRequestLocale.d.ts.map +1 -0
  122. package/dist/utilities/getRequestLocale.js +20 -0
  123. package/dist/utilities/getRequestLocale.js.map +1 -0
  124. package/dist/utilities/getRequestTheme.d.ts +10 -0
  125. package/dist/utilities/getRequestTheme.d.ts.map +1 -0
  126. package/dist/utilities/getRequestTheme.js +25 -0
  127. package/dist/utilities/getRequestTheme.js.map +1 -0
  128. package/dist/utilities/graphqlHandler.server.d.ts +12 -0
  129. package/dist/utilities/graphqlHandler.server.d.ts.map +1 -0
  130. package/dist/utilities/graphqlHandler.server.js +129 -0
  131. package/dist/utilities/graphqlHandler.server.js.map +1 -0
  132. package/dist/utilities/handleAPIRoute.d.ts +11 -0
  133. package/dist/utilities/handleAPIRoute.d.ts.map +1 -0
  134. package/dist/utilities/handleAPIRoute.js +17 -0
  135. package/dist/utilities/handleAPIRoute.js.map +1 -0
  136. package/dist/utilities/handleServerFunctions.d.ts +20 -0
  137. package/dist/utilities/handleServerFunctions.d.ts.map +1 -0
  138. package/dist/utilities/handleServerFunctions.js +60 -0
  139. package/dist/utilities/handleServerFunctions.js.map +1 -0
  140. package/dist/utilities/importMap.server.d.ts +8 -0
  141. package/dist/utilities/importMap.server.d.ts.map +1 -0
  142. package/dist/utilities/importMap.server.js +11 -0
  143. package/dist/utilities/importMap.server.js.map +1 -0
  144. package/dist/utilities/initReq.server.d.ts +19 -0
  145. package/dist/utilities/initReq.server.d.ts.map +1 -0
  146. package/dist/utilities/initReq.server.js +87 -0
  147. package/dist/utilities/initReq.server.js.map +1 -0
  148. package/dist/utilities/loadAdminPage.d.ts +54 -0
  149. package/dist/utilities/loadAdminPage.d.ts.map +1 -0
  150. package/dist/utilities/loadAdminPage.js +230 -0
  151. package/dist/utilities/loadAdminPage.js.map +1 -0
  152. package/dist/utilities/loadLayoutData.d.ts +15 -0
  153. package/dist/utilities/loadLayoutData.d.ts.map +1 -0
  154. package/dist/utilities/loadLayoutData.js +23 -0
  155. package/dist/utilities/loadLayoutData.js.map +1 -0
  156. package/dist/utilities/meta.d.ts +70 -0
  157. package/dist/utilities/meta.d.ts.map +1 -0
  158. package/dist/utilities/meta.js +142 -0
  159. package/dist/utilities/meta.js.map +1 -0
  160. package/dist/utilities/serializeForRsc.d.ts +26 -0
  161. package/dist/utilities/serializeForRsc.d.ts.map +1 -0
  162. package/dist/utilities/serializeForRsc.js +122 -0
  163. package/dist/utilities/serializeForRsc.js.map +1 -0
  164. package/dist/utilities/serverAdapter.server.d.ts +36 -0
  165. package/dist/utilities/serverAdapter.server.d.ts.map +1 -0
  166. package/dist/utilities/serverAdapter.server.js +130 -0
  167. package/dist/utilities/serverAdapter.server.js.map +1 -0
  168. package/dist/utilities/serverFunctionClient.d.ts +29 -0
  169. package/dist/utilities/serverFunctionClient.d.ts.map +1 -0
  170. package/dist/utilities/serverFunctionClient.js +109 -0
  171. package/dist/utilities/serverFunctionClient.js.map +1 -0
  172. package/dist/utilities/serverFunctionHandlers.d.ts +18 -0
  173. package/dist/utilities/serverFunctionHandlers.d.ts.map +1 -0
  174. package/dist/utilities/serverFunctionHandlers.js +17 -0
  175. package/dist/utilities/serverFunctionHandlers.js.map +1 -0
  176. package/dist/utilities/setPayloadAuthCookie.d.ts +9 -0
  177. package/dist/utilities/setPayloadAuthCookie.d.ts.map +1 -0
  178. package/dist/utilities/setPayloadAuthCookie.js +31 -0
  179. package/dist/utilities/setPayloadAuthCookie.js.map +1 -0
  180. package/dist/utilities/toSerializable.d.ts +2 -0
  181. package/dist/utilities/toSerializable.d.ts.map +1 -0
  182. package/dist/utilities/toSerializable.js +111 -0
  183. package/dist/utilities/toSerializable.js.map +1 -0
  184. package/dist/vite/constants.d.ts +42 -0
  185. package/dist/vite/constants.d.ts.map +1 -0
  186. package/dist/vite/constants.js +177 -0
  187. package/dist/vite/constants.js.map +1 -0
  188. package/dist/vite/importProtection.d.ts +14 -0
  189. package/dist/vite/importProtection.d.ts.map +1 -0
  190. package/dist/vite/importProtection.js +54 -0
  191. package/dist/vite/importProtection.js.map +1 -0
  192. package/dist/vite/plugin.d.ts +38 -0
  193. package/dist/vite/plugin.d.ts.map +1 -0
  194. package/dist/vite/plugin.js +177 -0
  195. package/dist/vite/plugin.js.map +1 -0
  196. package/dist/vite/plugins/clientModuleResolution.d.ts +14 -0
  197. package/dist/vite/plugins/clientModuleResolution.d.ts.map +1 -0
  198. package/dist/vite/plugins/clientModuleResolution.js +98 -0
  199. package/dist/vite/plugins/clientModuleResolution.js.map +1 -0
  200. package/dist/vite/plugins/devTransforms.d.ts +19 -0
  201. package/dist/vite/plugins/devTransforms.d.ts.map +1 -0
  202. package/dist/vite/plugins/devTransforms.js +67 -0
  203. package/dist/vite/plugins/devTransforms.js.map +1 -0
  204. package/dist/vite/plugins/reactDomServerInRsc.d.ts +27 -0
  205. package/dist/vite/plugins/reactDomServerInRsc.d.ts.map +1 -0
  206. package/dist/vite/plugins/reactDomServerInRsc.js +90 -0
  207. package/dist/vite/plugins/reactDomServerInRsc.js.map +1 -0
  208. package/dist/vite/plugins/stripDistStyleImports.d.ts +21 -0
  209. package/dist/vite/plugins/stripDistStyleImports.d.ts.map +1 -0
  210. package/dist/vite/plugins/stripDistStyleImports.js +140 -0
  211. package/dist/vite/plugins/stripDistStyleImports.js.map +1 -0
  212. package/dist/vite/plugins/wrapCjsForClient.d.ts +15 -0
  213. package/dist/vite/plugins/wrapCjsForClient.d.ts.map +1 -0
  214. package/dist/vite/plugins/wrapCjsForClient.js +106 -0
  215. package/dist/vite/plugins/wrapCjsForClient.js.map +1 -0
  216. package/package.json +106 -0
@@ -0,0 +1,54 @@
1
+ import { builtinModules } from 'node:module';
2
+ /**
3
+ * Specifiers that must never appear in the client module graph. These are the
4
+ * server-only Payload entry points plus Node.js built-ins and a handful of
5
+ * Node-only npm packages that Payload pulls in transitively.
6
+ */ export const serverOnlyClientSpecifiers = [
7
+ /^node:/,
8
+ new RegExp(`^(${builtinModules.join('|')})(\\/|$)`),
9
+ '@payload-config',
10
+ /^@payloadcms\/next\/rsc/,
11
+ /^@payloadcms\/richtext-lexical\/rsc/,
12
+ /^@payloadcms\/richtext-slate\/rsc/,
13
+ '@payloadcms/ui/server',
14
+ /^@payloadcms\/tanstack-start\/(layouts|rsc|server|views\/server)/,
15
+ 'sharp',
16
+ 'busboy',
17
+ 'croner',
18
+ 'pino',
19
+ 'pino-pretty',
20
+ 'prompts',
21
+ 'ws',
22
+ 'undici',
23
+ 'get-tsconfig',
24
+ /^file-type/,
25
+ /^react-dom\/server/
26
+ ];
27
+ /**
28
+ * Allowlist callback for the `tanstackStart` plugin's import-protection. These
29
+ * are the legitimate cross-environment imports in our monorepo that we want
30
+ * to permit even when they appear to cross a server/client boundary.
31
+ */ export function onImportProtectionViolation(violation) {
32
+ const info = violation;
33
+ const allowedClientFileImporters = /\/richtext-lexical\/.*\/exports\/client\/|\/tanstack-start\/.*\/views\/AdminView|\/ui\//;
34
+ if (info.envType === 'server' && info.resolved?.includes('.client.') && allowedClientFileImporters.test(info.importer)) {
35
+ return false;
36
+ }
37
+ if (info.importer.includes('/richtext-lexical/') && info.importer.includes('/field/Diff/')) {
38
+ return false;
39
+ }
40
+ if (info.importer.includes('/packages/payload/') || info.importer.includes('/payload/dist/')) {
41
+ return false;
42
+ }
43
+ if (info.importer.includes('@payloadcms/ui') && (info.importer.includes('/exports/rsc/') || info.importer.includes('/rsc/index'))) {
44
+ return false;
45
+ }
46
+ if (info.envType === 'server' && info.importer.includes('vite-rsc/client-references')) {
47
+ return false;
48
+ }
49
+ }
50
+ export const defaultImportProtectionIgnoreImporters = [
51
+ /^src\/importMap\.js(?:\?.*)?$/
52
+ ];
53
+
54
+ //# sourceMappingURL=importProtection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/vite/importProtection.ts"],"sourcesContent":["import { builtinModules } from 'node:module'\n\n/**\n * Specifiers that must never appear in the client module graph. These are the\n * server-only Payload entry points plus Node.js built-ins and a handful of\n * Node-only npm packages that Payload pulls in transitively.\n */\nexport const serverOnlyClientSpecifiers: Array<RegExp | string> = [\n /^node:/,\n new RegExp(`^(${builtinModules.join('|')})(\\\\/|$)`),\n '@payload-config',\n /^@payloadcms\\/next\\/rsc/,\n /^@payloadcms\\/richtext-lexical\\/rsc/,\n /^@payloadcms\\/richtext-slate\\/rsc/,\n '@payloadcms/ui/server',\n /^@payloadcms\\/tanstack-start\\/(layouts|rsc|server|views\\/server)/,\n 'sharp',\n 'busboy',\n 'croner',\n 'pino',\n 'pino-pretty',\n 'prompts',\n 'ws',\n 'undici',\n 'get-tsconfig',\n /^file-type/,\n /^react-dom\\/server/,\n]\n\n/**\n * Allowlist callback for the `tanstackStart` plugin's import-protection. These\n * are the legitimate cross-environment imports in our monorepo that we want\n * to permit even when they appear to cross a server/client boundary.\n */\nexport function onImportProtectionViolation(violation: unknown): boolean | void {\n const info = violation as {\n envType: 'client' | 'server'\n importer: string\n resolved?: string\n }\n\n const allowedClientFileImporters =\n /\\/richtext-lexical\\/.*\\/exports\\/client\\/|\\/tanstack-start\\/.*\\/views\\/AdminView|\\/ui\\//\n\n if (\n info.envType === 'server' &&\n info.resolved?.includes('.client.') &&\n allowedClientFileImporters.test(info.importer)\n ) {\n return false\n }\n\n if (info.importer.includes('/richtext-lexical/') && info.importer.includes('/field/Diff/')) {\n return false\n }\n\n if (info.importer.includes('/packages/payload/') || info.importer.includes('/payload/dist/')) {\n return false\n }\n\n if (\n info.importer.includes('@payloadcms/ui') &&\n (info.importer.includes('/exports/rsc/') || info.importer.includes('/rsc/index'))\n ) {\n return false\n }\n\n if (info.envType === 'server' && info.importer.includes('vite-rsc/client-references')) {\n return false\n }\n}\n\nexport const defaultImportProtectionIgnoreImporters: RegExp[] = [/^src\\/importMap\\.js(?:\\?.*)?$/]\n"],"names":["builtinModules","serverOnlyClientSpecifiers","RegExp","join","onImportProtectionViolation","violation","info","allowedClientFileImporters","envType","resolved","includes","test","importer","defaultImportProtectionIgnoreImporters"],"mappings":"AAAA,SAASA,cAAc,QAAQ,cAAa;AAE5C;;;;CAIC,GACD,OAAO,MAAMC,6BAAqD;IAChE;IACA,IAAIC,OAAO,CAAC,EAAE,EAAEF,eAAeG,IAAI,CAAC,KAAK,QAAQ,CAAC;IAClD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAA;AAED;;;;CAIC,GACD,OAAO,SAASC,4BAA4BC,SAAkB;IAC5D,MAAMC,OAAOD;IAMb,MAAME,6BACJ;IAEF,IACED,KAAKE,OAAO,KAAK,YACjBF,KAAKG,QAAQ,EAAEC,SAAS,eACxBH,2BAA2BI,IAAI,CAACL,KAAKM,QAAQ,GAC7C;QACA,OAAO;IACT;IAEA,IAAIN,KAAKM,QAAQ,CAACF,QAAQ,CAAC,yBAAyBJ,KAAKM,QAAQ,CAACF,QAAQ,CAAC,iBAAiB;QAC1F,OAAO;IACT;IAEA,IAAIJ,KAAKM,QAAQ,CAACF,QAAQ,CAAC,yBAAyBJ,KAAKM,QAAQ,CAACF,QAAQ,CAAC,mBAAmB;QAC5F,OAAO;IACT;IAEA,IACEJ,KAAKM,QAAQ,CAACF,QAAQ,CAAC,qBACtBJ,CAAAA,KAAKM,QAAQ,CAACF,QAAQ,CAAC,oBAAoBJ,KAAKM,QAAQ,CAACF,QAAQ,CAAC,aAAY,GAC/E;QACA,OAAO;IACT;IAEA,IAAIJ,KAAKE,OAAO,KAAK,YAAYF,KAAKM,QAAQ,CAACF,QAAQ,CAAC,+BAA+B;QACrF,OAAO;IACT;AACF;AAEA,OAAO,MAAMG,yCAAmD;IAAC;CAAgC,CAAA"}
@@ -0,0 +1,38 @@
1
+ import type { PluginOption, UserConfigFnObject } from 'vite';
2
+ export interface PayloadPluginOptions {
3
+ /** Additional resolve aliases */
4
+ additionalAliases?: Array<{
5
+ find: RegExp | string;
6
+ replacement: string;
7
+ }>;
8
+ /** Additional import protection ignoreImporters patterns */
9
+ additionalIgnoreImporters?: RegExp[];
10
+ /** Extra optimizeDeps.include entries */
11
+ additionalOptimizeDepsInclude?: string[];
12
+ /** Extra ssr.external entries */
13
+ additionalSsrExternal?: string[];
14
+ /** Path to the user's payload.config.ts (required) */
15
+ payloadConfigPath: string;
16
+ /** Extra Vite plugins to include */
17
+ plugins?: PluginOption[];
18
+ /** @vitejs/plugin-react instance — must be passed by consumer to ensure correct resolution */
19
+ reactPlugin: PluginOption;
20
+ /** TanStack router routes directory relative to srcDirectory. Defaults to 'app' */
21
+ routesDirectory?: string;
22
+ /** @vitejs/plugin-rsc instance — required for RSC support, must be passed by consumer */
23
+ rscPlugin: PluginOption;
24
+ /** TanStack source directory. Defaults to 'src' */
25
+ srcDirectory?: string;
26
+ /** tanstackStart from '@tanstack/react-start/plugin/vite' — must be passed by consumer to ensure correct resolution */
27
+ tanstackStart: typeof import('@tanstack/react-start/plugin/vite').tanstackStart;
28
+ }
29
+ /**
30
+ * Vite plugin for Payload + TanStack Start. The Vite-side counterpart to
31
+ * `withPayload` for Next.js: it configures the Vite environment so the Payload
32
+ * admin can run, then composes the TanStack Start plugin with two small
33
+ * Payload-specific workarounds (dev HMR injection, SSR style stripping). Each
34
+ * remaining workaround lives in its own file under `./plugins/` so it can be
35
+ * deleted individually once the corresponding upstream fix lands.
36
+ */
37
+ export declare function payloadPlugin(options: PayloadPluginOptions): UserConfigFnObject;
38
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/vite/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAA;AAsB5D,MAAM,WAAW,oBAAoB;IACnC,iCAAiC;IACjC,iBAAiB,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACzE,4DAA4D;IAC5D,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAA;IACpC,yCAAyC;IACzC,6BAA6B,CAAC,EAAE,MAAM,EAAE,CAAA;IACxC,iCAAiC;IACjC,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAA;IAChC,sDAAsD;IACtD,iBAAiB,EAAE,MAAM,CAAA;IACzB,oCAAoC;IACpC,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,8FAA8F;IAC9F,WAAW,EAAE,YAAY,CAAA;IACzB,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,yFAAyF;IACzF,SAAS,EAAE,YAAY,CAAA;IACvB,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,uHAAuH;IACvH,aAAa,EAAE,cAAc,mCAAmC,EAAE,aAAa,CAAA;CAChF;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,kBAAkB,CA+H/E"}
@@ -0,0 +1,177 @@
1
+ import path from 'node:path';
2
+ import { optimizeDepsExcludeDefaults, optimizeDepsIncludeDefaults, payloadNoExternalPatterns, payloadRscNoExternalPatterns, ssrExternalPackages } from './constants.js';
3
+ import { defaultImportProtectionIgnoreImporters, onImportProtectionViolation, serverOnlyClientSpecifiers } from './importProtection.js';
4
+ import { clientModuleResolution } from './plugins/clientModuleResolution.js';
5
+ import { payloadDevTransforms } from './plugins/devTransforms.js';
6
+ import { reactDomServerInRsc } from './plugins/reactDomServerInRsc.js';
7
+ import { ssrStripDistStyleImports } from './plugins/stripDistStyleImports.js';
8
+ import { wrapCjsForClient } from './plugins/wrapCjsForClient.js';
9
+ /**
10
+ * Vite plugin for Payload + TanStack Start. The Vite-side counterpart to
11
+ * `withPayload` for Next.js: it configures the Vite environment so the Payload
12
+ * admin can run, then composes the TanStack Start plugin with two small
13
+ * Payload-specific workarounds (dev HMR injection, SSR style stripping). Each
14
+ * remaining workaround lives in its own file under `./plugins/` so it can be
15
+ * deleted individually once the corresponding upstream fix lands.
16
+ */ export function payloadPlugin(options) {
17
+ const { additionalAliases = [], additionalIgnoreImporters = [], additionalOptimizeDepsInclude = [], additionalSsrExternal = [], payloadConfigPath, plugins: extraPlugins = [], reactPlugin, routesDirectory = 'app', rscPlugin, srcDirectory = 'src', tanstackStart } = options;
18
+ return (_env)=>({
19
+ css: {
20
+ preprocessorOptions: {
21
+ scss: {
22
+ silenceDeprecations: [
23
+ 'import',
24
+ 'global-builtin'
25
+ ]
26
+ }
27
+ }
28
+ },
29
+ define: {
30
+ global: 'globalThis'
31
+ },
32
+ environments: {
33
+ rsc: {
34
+ resolve: {
35
+ noExternal: payloadRscNoExternalPatterns
36
+ }
37
+ },
38
+ ssr: {
39
+ resolve: {
40
+ noExternal: payloadNoExternalPatterns
41
+ }
42
+ }
43
+ },
44
+ optimizeDeps: {
45
+ exclude: optimizeDepsExcludeDefaults,
46
+ include: [
47
+ ...optimizeDepsIncludeDefaults,
48
+ ...additionalOptimizeDepsInclude
49
+ ]
50
+ },
51
+ plugins: [
52
+ clientModuleResolution(),
53
+ wrapCjsForClient(),
54
+ ssrStripDistStyleImports(),
55
+ reactDomServerInRsc(),
56
+ payloadDevTransforms(),
57
+ rscPlugin,
58
+ tanstackStart({
59
+ importProtection: {
60
+ client: {
61
+ excludeFiles: [],
62
+ specifiers: serverOnlyClientSpecifiers
63
+ },
64
+ ignoreImporters: [
65
+ ...defaultImportProtectionIgnoreImporters,
66
+ ...additionalIgnoreImporters
67
+ ],
68
+ include: [
69
+ '**/*'
70
+ ],
71
+ mockAccess: 'warn',
72
+ onViolation: onImportProtectionViolation,
73
+ // Disable TanStack Start's default `**/*.client.*` file-based denial in
74
+ // the SSR environment. Payload uses the `.client.tsx` filename suffix
75
+ // for React Client Components (with a `'use client'` directive) that
76
+ // MUST be server-rendered to HTML during SSR. The default rule would
77
+ // otherwise replace those files with an `import-protection mock` Proxy
78
+ // during SSR, which crashes React (TypeError: Cannot convert object to
79
+ // primitive value) the moment React tries to format a warning that
80
+ // mentions one of these components.
81
+ server: {
82
+ files: []
83
+ }
84
+ },
85
+ // Disable TanStack Router's automatic per-route code-splitting.
86
+ //
87
+ // With splitting enabled each route's `component` is fetched lazily
88
+ // via `?tsr-split=component` after the initial SSR HTML is streamed.
89
+ // Until that lazy chunk lands the rendered admin tree has no client
90
+ // React attached, so any button clicks (e.g. the
91
+ // `#toggle-list-filters` chevron in `<ListControls />`) hit a static
92
+ // DOM, the click is dropped, and once the chunk finally loads the
93
+ // component re-mounts with its initial `useState` instead of the
94
+ // toggled value. That single behaviour was the root cause of the
95
+ // "page renders but nothing is interactive" tanstack-start E2E
96
+ // failures (`#list-controls-where`, `[data-lexical-editor]`, etc.) -
97
+ // playwright traces show "Download the React DevTools" landing
98
+ // *after* the playwright click, confirming late hydration.
99
+ //
100
+ // We pass BOTH knobs because `tanstackStart`'s schema silently
101
+ // strips the user-supplied `autoCodeSplitting` (its `tsrConfig`
102
+ // does `configSchema.omit({ autoCodeSplitting: true, target: true
103
+ // })`) and then leaves the value `undefined` — which is fine for
104
+ // the conditional inside `unpluginRouterComposedFactory`, but the
105
+ // TanStack Start vite plugin *unconditionally* installs the router
106
+ // code-splitter via `tanStackRouterCodeSplitter(...)` regardless.
107
+ // The only knob that survives all of that and is honoured by the
108
+ // splitter is `router.codeSplittingOptions.defaultBehavior` — set
109
+ // to an empty array, the splitter still walks each `createFileRoute`
110
+ // file but produces no virtual `?tsr-split=...` modules, so every
111
+ // route component ships in the initial bundle and hydration starts
112
+ // immediately on first paint. We keep `autoCodeSplitting: false` as
113
+ // a belt-and-braces signal in case the start plugin ever stops
114
+ // dropping it.
115
+ //
116
+ // Eager-loading routes ships a slightly larger initial bundle but
117
+ // makes the admin actually interactive on first paint.
118
+ router: {
119
+ autoCodeSplitting: false,
120
+ codeSplittingOptions: {
121
+ defaultBehavior: []
122
+ },
123
+ // Exclude generated importMap files and colocated server-function
124
+ // modules (`*.functions.ts`). Admin form saves are dispatched via
125
+ // `runPayloadServerFn` (a TanStack Start `createServerFn`) rather than
126
+ // a hand-rolled route, so there is no longer an `api.server-function.ts`
127
+ // to special-case here. The `*.functions.ts` shims live next to the
128
+ // routes that use them (e.g. `app/_payload/*.functions.ts`); they
129
+ // define `createServerFn`s, not routes, so they must not be scanned.
130
+ routeFileIgnorePattern: 'importMap\\.(?:js|server\\.ts)$|\\.functions\\.',
131
+ routesDirectory
132
+ },
133
+ rsc: {
134
+ enabled: true
135
+ },
136
+ srcDirectory
137
+ }),
138
+ reactPlugin,
139
+ ...extraPlugins
140
+ ],
141
+ resolve: {
142
+ alias: [
143
+ {
144
+ find: '@payload-config',
145
+ replacement: path.resolve(payloadConfigPath)
146
+ },
147
+ ...additionalAliases
148
+ ],
149
+ dedupe: [
150
+ 'react',
151
+ 'react-dom',
152
+ 'scheduler',
153
+ '@payloadcms/ui',
154
+ '@payloadcms/richtext-lexical'
155
+ ],
156
+ extensions: [
157
+ '.mjs',
158
+ '.js',
159
+ '.mts',
160
+ '.ts',
161
+ '.jsx',
162
+ '.tsx',
163
+ '.json'
164
+ ],
165
+ tsconfigPaths: true
166
+ },
167
+ ssr: {
168
+ external: [
169
+ ...ssrExternalPackages,
170
+ ...additionalSsrExternal
171
+ ],
172
+ noExternal: payloadNoExternalPatterns
173
+ }
174
+ });
175
+ }
176
+
177
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/vite/plugin.ts"],"sourcesContent":["import type { PluginOption, UserConfigFnObject } from 'vite'\n\nimport path from 'node:path'\n\nimport {\n optimizeDepsExcludeDefaults,\n optimizeDepsIncludeDefaults,\n payloadNoExternalPatterns,\n payloadRscNoExternalPatterns,\n ssrExternalPackages,\n} from './constants.js'\nimport {\n defaultImportProtectionIgnoreImporters,\n onImportProtectionViolation,\n serverOnlyClientSpecifiers,\n} from './importProtection.js'\nimport { clientModuleResolution } from './plugins/clientModuleResolution.js'\nimport { payloadDevTransforms } from './plugins/devTransforms.js'\nimport { reactDomServerInRsc } from './plugins/reactDomServerInRsc.js'\nimport { ssrStripDistStyleImports } from './plugins/stripDistStyleImports.js'\nimport { wrapCjsForClient } from './plugins/wrapCjsForClient.js'\n\nexport interface PayloadPluginOptions {\n /** Additional resolve aliases */\n additionalAliases?: Array<{ find: RegExp | string; replacement: string }>\n /** Additional import protection ignoreImporters patterns */\n additionalIgnoreImporters?: RegExp[]\n /** Extra optimizeDeps.include entries */\n additionalOptimizeDepsInclude?: string[]\n /** Extra ssr.external entries */\n additionalSsrExternal?: string[]\n /** Path to the user's payload.config.ts (required) */\n payloadConfigPath: string\n /** Extra Vite plugins to include */\n plugins?: PluginOption[]\n /** @vitejs/plugin-react instance — must be passed by consumer to ensure correct resolution */\n reactPlugin: PluginOption\n /** TanStack router routes directory relative to srcDirectory. Defaults to 'app' */\n routesDirectory?: string\n /** @vitejs/plugin-rsc instance — required for RSC support, must be passed by consumer */\n rscPlugin: PluginOption\n /** TanStack source directory. Defaults to 'src' */\n srcDirectory?: string\n /** tanstackStart from '@tanstack/react-start/plugin/vite' — must be passed by consumer to ensure correct resolution */\n tanstackStart: typeof import('@tanstack/react-start/plugin/vite').tanstackStart\n}\n\n/**\n * Vite plugin for Payload + TanStack Start. The Vite-side counterpart to\n * `withPayload` for Next.js: it configures the Vite environment so the Payload\n * admin can run, then composes the TanStack Start plugin with two small\n * Payload-specific workarounds (dev HMR injection, SSR style stripping). Each\n * remaining workaround lives in its own file under `./plugins/` so it can be\n * deleted individually once the corresponding upstream fix lands.\n */\nexport function payloadPlugin(options: PayloadPluginOptions): UserConfigFnObject {\n const {\n additionalAliases = [],\n additionalIgnoreImporters = [],\n additionalOptimizeDepsInclude = [],\n additionalSsrExternal = [],\n payloadConfigPath,\n plugins: extraPlugins = [],\n reactPlugin,\n routesDirectory = 'app',\n rscPlugin,\n srcDirectory = 'src',\n tanstackStart,\n } = options\n\n return (_env) => ({\n css: {\n preprocessorOptions: {\n scss: {\n silenceDeprecations: ['import', 'global-builtin'],\n } as any,\n },\n },\n define: {\n global: 'globalThis',\n },\n environments: {\n rsc: { resolve: { noExternal: payloadRscNoExternalPatterns } },\n ssr: { resolve: { noExternal: payloadNoExternalPatterns } },\n } as any,\n optimizeDeps: {\n exclude: optimizeDepsExcludeDefaults,\n include: [...optimizeDepsIncludeDefaults, ...additionalOptimizeDepsInclude],\n },\n plugins: [\n clientModuleResolution(),\n wrapCjsForClient(),\n ssrStripDistStyleImports(),\n reactDomServerInRsc(),\n payloadDevTransforms(),\n rscPlugin,\n tanstackStart({\n importProtection: {\n client: { excludeFiles: [], specifiers: serverOnlyClientSpecifiers },\n ignoreImporters: [\n ...defaultImportProtectionIgnoreImporters,\n ...additionalIgnoreImporters,\n ],\n include: ['**/*'],\n mockAccess: 'warn',\n onViolation: onImportProtectionViolation,\n // Disable TanStack Start's default `**/*.client.*` file-based denial in\n // the SSR environment. Payload uses the `.client.tsx` filename suffix\n // for React Client Components (with a `'use client'` directive) that\n // MUST be server-rendered to HTML during SSR. The default rule would\n // otherwise replace those files with an `import-protection mock` Proxy\n // during SSR, which crashes React (TypeError: Cannot convert object to\n // primitive value) the moment React tries to format a warning that\n // mentions one of these components.\n server: { files: [] },\n },\n // Disable TanStack Router's automatic per-route code-splitting.\n //\n // With splitting enabled each route's `component` is fetched lazily\n // via `?tsr-split=component` after the initial SSR HTML is streamed.\n // Until that lazy chunk lands the rendered admin tree has no client\n // React attached, so any button clicks (e.g. the\n // `#toggle-list-filters` chevron in `<ListControls />`) hit a static\n // DOM, the click is dropped, and once the chunk finally loads the\n // component re-mounts with its initial `useState` instead of the\n // toggled value. That single behaviour was the root cause of the\n // \"page renders but nothing is interactive\" tanstack-start E2E\n // failures (`#list-controls-where`, `[data-lexical-editor]`, etc.) -\n // playwright traces show \"Download the React DevTools\" landing\n // *after* the playwright click, confirming late hydration.\n //\n // We pass BOTH knobs because `tanstackStart`'s schema silently\n // strips the user-supplied `autoCodeSplitting` (its `tsrConfig`\n // does `configSchema.omit({ autoCodeSplitting: true, target: true\n // })`) and then leaves the value `undefined` — which is fine for\n // the conditional inside `unpluginRouterComposedFactory`, but the\n // TanStack Start vite plugin *unconditionally* installs the router\n // code-splitter via `tanStackRouterCodeSplitter(...)` regardless.\n // The only knob that survives all of that and is honoured by the\n // splitter is `router.codeSplittingOptions.defaultBehavior` — set\n // to an empty array, the splitter still walks each `createFileRoute`\n // file but produces no virtual `?tsr-split=...` modules, so every\n // route component ships in the initial bundle and hydration starts\n // immediately on first paint. We keep `autoCodeSplitting: false` as\n // a belt-and-braces signal in case the start plugin ever stops\n // dropping it.\n //\n // Eager-loading routes ships a slightly larger initial bundle but\n // makes the admin actually interactive on first paint.\n router: {\n autoCodeSplitting: false,\n codeSplittingOptions: { defaultBehavior: [] },\n // Exclude generated importMap files and colocated server-function\n // modules (`*.functions.ts`). Admin form saves are dispatched via\n // `runPayloadServerFn` (a TanStack Start `createServerFn`) rather than\n // a hand-rolled route, so there is no longer an `api.server-function.ts`\n // to special-case here. The `*.functions.ts` shims live next to the\n // routes that use them (e.g. `app/_payload/*.functions.ts`); they\n // define `createServerFn`s, not routes, so they must not be scanned.\n routeFileIgnorePattern: 'importMap\\\\.(?:js|server\\\\.ts)$|\\\\.functions\\\\.',\n routesDirectory,\n } as any,\n rsc: { enabled: true },\n srcDirectory,\n }),\n reactPlugin,\n ...extraPlugins,\n ],\n resolve: {\n alias: [\n { find: '@payload-config', replacement: path.resolve(payloadConfigPath) },\n ...additionalAliases,\n ],\n dedupe: ['react', 'react-dom', 'scheduler', '@payloadcms/ui', '@payloadcms/richtext-lexical'],\n extensions: ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json'],\n tsconfigPaths: true,\n } as any,\n ssr: {\n external: [...ssrExternalPackages, ...additionalSsrExternal],\n noExternal: payloadNoExternalPatterns,\n },\n })\n}\n"],"names":["path","optimizeDepsExcludeDefaults","optimizeDepsIncludeDefaults","payloadNoExternalPatterns","payloadRscNoExternalPatterns","ssrExternalPackages","defaultImportProtectionIgnoreImporters","onImportProtectionViolation","serverOnlyClientSpecifiers","clientModuleResolution","payloadDevTransforms","reactDomServerInRsc","ssrStripDistStyleImports","wrapCjsForClient","payloadPlugin","options","additionalAliases","additionalIgnoreImporters","additionalOptimizeDepsInclude","additionalSsrExternal","payloadConfigPath","plugins","extraPlugins","reactPlugin","routesDirectory","rscPlugin","srcDirectory","tanstackStart","_env","css","preprocessorOptions","scss","silenceDeprecations","define","global","environments","rsc","resolve","noExternal","ssr","optimizeDeps","exclude","include","importProtection","client","excludeFiles","specifiers","ignoreImporters","mockAccess","onViolation","server","files","router","autoCodeSplitting","codeSplittingOptions","defaultBehavior","routeFileIgnorePattern","enabled","alias","find","replacement","dedupe","extensions","tsconfigPaths","external"],"mappings":"AAEA,OAAOA,UAAU,YAAW;AAE5B,SACEC,2BAA2B,EAC3BC,2BAA2B,EAC3BC,yBAAyB,EACzBC,4BAA4B,EAC5BC,mBAAmB,QACd,iBAAgB;AACvB,SACEC,sCAAsC,EACtCC,2BAA2B,EAC3BC,0BAA0B,QACrB,wBAAuB;AAC9B,SAASC,sBAAsB,QAAQ,sCAAqC;AAC5E,SAASC,oBAAoB,QAAQ,6BAA4B;AACjE,SAASC,mBAAmB,QAAQ,mCAAkC;AACtE,SAASC,wBAAwB,QAAQ,qCAAoC;AAC7E,SAASC,gBAAgB,QAAQ,gCAA+B;AA2BhE;;;;;;;CAOC,GACD,OAAO,SAASC,cAAcC,OAA6B;IACzD,MAAM,EACJC,oBAAoB,EAAE,EACtBC,4BAA4B,EAAE,EAC9BC,gCAAgC,EAAE,EAClCC,wBAAwB,EAAE,EAC1BC,iBAAiB,EACjBC,SAASC,eAAe,EAAE,EAC1BC,WAAW,EACXC,kBAAkB,KAAK,EACvBC,SAAS,EACTC,eAAe,KAAK,EACpBC,aAAa,EACd,GAAGZ;IAEJ,OAAO,CAACa,OAAU,CAAA;YAChBC,KAAK;gBACHC,qBAAqB;oBACnBC,MAAM;wBACJC,qBAAqB;4BAAC;4BAAU;yBAAiB;oBACnD;gBACF;YACF;YACAC,QAAQ;gBACNC,QAAQ;YACV;YACAC,cAAc;gBACZC,KAAK;oBAAEC,SAAS;wBAAEC,YAAYlC;oBAA6B;gBAAE;gBAC7DmC,KAAK;oBAAEF,SAAS;wBAAEC,YAAYnC;oBAA0B;gBAAE;YAC5D;YACAqC,cAAc;gBACZC,SAASxC;gBACTyC,SAAS;uBAAIxC;uBAAgCgB;iBAA8B;YAC7E;YACAG,SAAS;gBACPZ;gBACAI;gBACAD;gBACAD;gBACAD;gBACAe;gBACAE,cAAc;oBACZgB,kBAAkB;wBAChBC,QAAQ;4BAAEC,cAAc,EAAE;4BAAEC,YAAYtC;wBAA2B;wBACnEuC,iBAAiB;+BACZzC;+BACAW;yBACJ;wBACDyB,SAAS;4BAAC;yBAAO;wBACjBM,YAAY;wBACZC,aAAa1C;wBACb,wEAAwE;wBACxE,sEAAsE;wBACtE,qEAAqE;wBACrE,qEAAqE;wBACrE,uEAAuE;wBACvE,uEAAuE;wBACvE,mEAAmE;wBACnE,oCAAoC;wBACpC2C,QAAQ;4BAAEC,OAAO,EAAE;wBAAC;oBACtB;oBACA,gEAAgE;oBAChE,EAAE;oBACF,oEAAoE;oBACpE,qEAAqE;oBACrE,oEAAoE;oBACpE,iDAAiD;oBACjD,qEAAqE;oBACrE,kEAAkE;oBAClE,iEAAiE;oBACjE,iEAAiE;oBACjE,+DAA+D;oBAC/D,qEAAqE;oBACrE,+DAA+D;oBAC/D,2DAA2D;oBAC3D,EAAE;oBACF,+DAA+D;oBAC/D,gEAAgE;oBAChE,kEAAkE;oBAClE,iEAAiE;oBACjE,kEAAkE;oBAClE,mEAAmE;oBACnE,kEAAkE;oBAClE,iEAAiE;oBACjE,kEAAkE;oBAClE,qEAAqE;oBACrE,kEAAkE;oBAClE,mEAAmE;oBACnE,oEAAoE;oBACpE,+DAA+D;oBAC/D,eAAe;oBACf,EAAE;oBACF,kEAAkE;oBAClE,uDAAuD;oBACvDC,QAAQ;wBACNC,mBAAmB;wBACnBC,sBAAsB;4BAAEC,iBAAiB,EAAE;wBAAC;wBAC5C,kEAAkE;wBAClE,kEAAkE;wBAClE,uEAAuE;wBACvE,yEAAyE;wBACzE,oEAAoE;wBACpE,kEAAkE;wBAClE,qEAAqE;wBACrEC,wBAAwB;wBACxBhC;oBACF;oBACAY,KAAK;wBAAEqB,SAAS;oBAAK;oBACrB/B;gBACF;gBACAH;mBACGD;aACJ;YACDe,SAAS;gBACPqB,OAAO;oBACL;wBAAEC,MAAM;wBAAmBC,aAAa5D,KAAKqC,OAAO,CAACjB;oBAAmB;uBACrEJ;iBACJ;gBACD6C,QAAQ;oBAAC;oBAAS;oBAAa;oBAAa;oBAAkB;iBAA+B;gBAC7FC,YAAY;oBAAC;oBAAQ;oBAAO;oBAAQ;oBAAO;oBAAQ;oBAAQ;iBAAQ;gBACnEC,eAAe;YACjB;YACAxB,KAAK;gBACHyB,UAAU;uBAAI3D;uBAAwBc;iBAAsB;gBAC5DmB,YAAYnC;YACd;QACF,CAAA;AACF"}
@@ -0,0 +1,14 @@
1
+ import type { PluginOption } from 'vite';
2
+ /**
3
+ * Client-side module resolution:
4
+ * 1. Stubs RSC modules (`@payloadcms/.../rsc`) with no-op components so the
5
+ * Vite optimizer never tries to bundle their server implementations.
6
+ * 2. Redirects bare `payload` imports made from user code (outside of
7
+ * `node_modules` and our own packages) to `payload/shared`. The main
8
+ * `payload` entry has top-level side effects requiring Node.js APIs.
9
+ * 3. Resolves `/client` subpath exports for `@payloadcms/plugin-*` and
10
+ * `@payloadcms/storage-*` packages when normal Vite resolution fails in
11
+ * monorepo dev (no `dist/` built yet).
12
+ */
13
+ export declare function clientModuleResolution(): PluginOption;
14
+ //# sourceMappingURL=clientModuleResolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientModuleResolution.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/clientModuleResolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAKxC;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,IAAI,YAAY,CA+ErD"}
@@ -0,0 +1,98 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ /**
4
+ * Client-side module resolution:
5
+ * 1. Stubs RSC modules (`@payloadcms/.../rsc`) with no-op components so the
6
+ * Vite optimizer never tries to bundle their server implementations.
7
+ * 2. Redirects bare `payload` imports made from user code (outside of
8
+ * `node_modules` and our own packages) to `payload/shared`. The main
9
+ * `payload` entry has top-level side effects requiring Node.js APIs.
10
+ * 3. Resolves `/client` subpath exports for `@payloadcms/plugin-*` and
11
+ * `@payloadcms/storage-*` packages when normal Vite resolution fails in
12
+ * monorepo dev (no `dist/` built yet).
13
+ */ export function clientModuleResolution() {
14
+ const stubPrefix = '\0payload:server-stub:';
15
+ const serverOnlyPatterns = [
16
+ /^@payloadcms\/richtext-lexical\/rsc$/,
17
+ /^@payloadcms\/richtext-slate\/rsc$/,
18
+ /^@payloadcms\/next\/rsc$/,
19
+ /^@payloadcms\/tanstack-start\/rsc$/
20
+ ];
21
+ const serverOnlyExports = {
22
+ '@payloadcms/next/rsc': [
23
+ 'CollectionCards',
24
+ 'HierarchyTypeFieldServer'
25
+ ],
26
+ '@payloadcms/richtext-lexical/rsc': [
27
+ 'RscEntryLexicalCell',
28
+ 'RscEntryLexicalField',
29
+ 'LexicalDiffComponent'
30
+ ],
31
+ '@payloadcms/tanstack-start/rsc': [
32
+ 'CollectionCards',
33
+ 'HierarchyTypeFieldServer',
34
+ 'renderPayloadComponentOnServer'
35
+ ]
36
+ };
37
+ return {
38
+ name: 'payload:client-module-resolution',
39
+ enforce: 'pre',
40
+ load (id) {
41
+ if (!id.startsWith(stubPrefix)) {
42
+ return;
43
+ }
44
+ const specifier = id.slice(stubPrefix.length);
45
+ const exports = serverOnlyExports[specifier];
46
+ if (exports) {
47
+ return exports.map((name)=>`export const ${name} = () => null;`).join('\n');
48
+ }
49
+ return `export default null;`;
50
+ },
51
+ async resolveId (id, importer, options) {
52
+ if (options?.ssr) {
53
+ return;
54
+ }
55
+ if (serverOnlyPatterns.some((p)=>p.test(id))) {
56
+ return stubPrefix + id;
57
+ }
58
+ if (id === 'payload' && importer && !importer.includes('/node_modules/')) {
59
+ const isPayloadPackage = /\/packages\/(?:payload|ui|richtext-|tanstack-start|next)\//.test(importer);
60
+ if (!isPayloadPackage) {
61
+ return this.resolve('payload/shared', importer, {
62
+ ...options,
63
+ skipSelf: true
64
+ });
65
+ }
66
+ }
67
+ if (/^@payloadcms\/(?:plugin|storage)-[^/]+\/client$/.test(id)) {
68
+ const resolved = await this.resolve(id, importer, {
69
+ ...options,
70
+ skipSelf: true
71
+ });
72
+ if (resolved) {
73
+ return resolved;
74
+ }
75
+ const pkgName = id.replace(/\/client$/, '');
76
+ const pkgResolved = await this.resolve(pkgName, importer, {
77
+ ...options,
78
+ skipSelf: true
79
+ });
80
+ if (pkgResolved) {
81
+ const pkgDir = path.dirname(pkgResolved.id);
82
+ const candidates = [
83
+ path.resolve(pkgDir, 'src', 'exports', 'client.ts'),
84
+ path.resolve(pkgDir, 'src', 'exports', 'client.js'),
85
+ path.resolve(pkgDir, 'dist', 'exports', 'client.js')
86
+ ];
87
+ for (const candidate of candidates){
88
+ if (fs.existsSync(candidate)) {
89
+ return candidate;
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ };
96
+ }
97
+
98
+ //# sourceMappingURL=clientModuleResolution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/vite/plugins/clientModuleResolution.ts"],"sourcesContent":["import type { PluginOption } from 'vite'\n\nimport fs from 'node:fs'\nimport path from 'node:path'\n\n/**\n * Client-side module resolution:\n * 1. Stubs RSC modules (`@payloadcms/.../rsc`) with no-op components so the\n * Vite optimizer never tries to bundle their server implementations.\n * 2. Redirects bare `payload` imports made from user code (outside of\n * `node_modules` and our own packages) to `payload/shared`. The main\n * `payload` entry has top-level side effects requiring Node.js APIs.\n * 3. Resolves `/client` subpath exports for `@payloadcms/plugin-*` and\n * `@payloadcms/storage-*` packages when normal Vite resolution fails in\n * monorepo dev (no `dist/` built yet).\n */\nexport function clientModuleResolution(): PluginOption {\n const stubPrefix = '\\0payload:server-stub:'\n\n const serverOnlyPatterns: RegExp[] = [\n /^@payloadcms\\/richtext-lexical\\/rsc$/,\n /^@payloadcms\\/richtext-slate\\/rsc$/,\n /^@payloadcms\\/next\\/rsc$/,\n /^@payloadcms\\/tanstack-start\\/rsc$/,\n ]\n\n const serverOnlyExports: Record<string, string[]> = {\n '@payloadcms/next/rsc': ['CollectionCards', 'HierarchyTypeFieldServer'],\n '@payloadcms/richtext-lexical/rsc': [\n 'RscEntryLexicalCell',\n 'RscEntryLexicalField',\n 'LexicalDiffComponent',\n ],\n '@payloadcms/tanstack-start/rsc': [\n 'CollectionCards',\n 'HierarchyTypeFieldServer',\n 'renderPayloadComponentOnServer',\n ],\n }\n\n return {\n name: 'payload:client-module-resolution',\n enforce: 'pre',\n load(id) {\n if (!id.startsWith(stubPrefix)) {\n return\n }\n const specifier = id.slice(stubPrefix.length)\n const exports = serverOnlyExports[specifier]\n if (exports) {\n return exports.map((name) => `export const ${name} = () => null;`).join('\\n')\n }\n return `export default null;`\n },\n async resolveId(id, importer, options) {\n if (options?.ssr) {\n return\n }\n\n if (serverOnlyPatterns.some((p) => p.test(id))) {\n return stubPrefix + id\n }\n\n if (id === 'payload' && importer && !importer.includes('/node_modules/')) {\n const isPayloadPackage = /\\/packages\\/(?:payload|ui|richtext-|tanstack-start|next)\\//.test(\n importer,\n )\n if (!isPayloadPackage) {\n return this.resolve('payload/shared', importer, { ...options, skipSelf: true })\n }\n }\n\n if (/^@payloadcms\\/(?:plugin|storage)-[^/]+\\/client$/.test(id)) {\n const resolved = await this.resolve(id, importer, { ...options, skipSelf: true })\n if (resolved) {\n return resolved\n }\n const pkgName = id.replace(/\\/client$/, '')\n const pkgResolved = await this.resolve(pkgName, importer, { ...options, skipSelf: true })\n if (pkgResolved) {\n const pkgDir = path.dirname(pkgResolved.id)\n const candidates = [\n path.resolve(pkgDir, 'src', 'exports', 'client.ts'),\n path.resolve(pkgDir, 'src', 'exports', 'client.js'),\n path.resolve(pkgDir, 'dist', 'exports', 'client.js'),\n ]\n for (const candidate of candidates) {\n if (fs.existsSync(candidate)) {\n return candidate\n }\n }\n }\n }\n },\n }\n}\n"],"names":["fs","path","clientModuleResolution","stubPrefix","serverOnlyPatterns","serverOnlyExports","name","enforce","load","id","startsWith","specifier","slice","length","exports","map","join","resolveId","importer","options","ssr","some","p","test","includes","isPayloadPackage","resolve","skipSelf","resolved","pkgName","replace","pkgResolved","pkgDir","dirname","candidates","candidate","existsSync"],"mappings":"AAEA,OAAOA,QAAQ,UAAS;AACxB,OAAOC,UAAU,YAAW;AAE5B;;;;;;;;;;CAUC,GACD,OAAO,SAASC;IACd,MAAMC,aAAa;IAEnB,MAAMC,qBAA+B;QACnC;QACA;QACA;QACA;KACD;IAED,MAAMC,oBAA8C;QAClD,wBAAwB;YAAC;YAAmB;SAA2B;QACvE,oCAAoC;YAClC;YACA;YACA;SACD;QACD,kCAAkC;YAChC;YACA;YACA;SACD;IACH;IAEA,OAAO;QACLC,MAAM;QACNC,SAAS;QACTC,MAAKC,EAAE;YACL,IAAI,CAACA,GAAGC,UAAU,CAACP,aAAa;gBAC9B;YACF;YACA,MAAMQ,YAAYF,GAAGG,KAAK,CAACT,WAAWU,MAAM;YAC5C,MAAMC,UAAUT,iBAAiB,CAACM,UAAU;YAC5C,IAAIG,SAAS;gBACX,OAAOA,QAAQC,GAAG,CAAC,CAACT,OAAS,CAAC,aAAa,EAAEA,KAAK,cAAc,CAAC,EAAEU,IAAI,CAAC;YAC1E;YACA,OAAO,CAAC,oBAAoB,CAAC;QAC/B;QACA,MAAMC,WAAUR,EAAE,EAAES,QAAQ,EAAEC,OAAO;YACnC,IAAIA,SAASC,KAAK;gBAChB;YACF;YAEA,IAAIhB,mBAAmBiB,IAAI,CAAC,CAACC,IAAMA,EAAEC,IAAI,CAACd,MAAM;gBAC9C,OAAON,aAAaM;YACtB;YAEA,IAAIA,OAAO,aAAaS,YAAY,CAACA,SAASM,QAAQ,CAAC,mBAAmB;gBACxE,MAAMC,mBAAmB,6DAA6DF,IAAI,CACxFL;gBAEF,IAAI,CAACO,kBAAkB;oBACrB,OAAO,IAAI,CAACC,OAAO,CAAC,kBAAkBR,UAAU;wBAAE,GAAGC,OAAO;wBAAEQ,UAAU;oBAAK;gBAC/E;YACF;YAEA,IAAI,kDAAkDJ,IAAI,CAACd,KAAK;gBAC9D,MAAMmB,WAAW,MAAM,IAAI,CAACF,OAAO,CAACjB,IAAIS,UAAU;oBAAE,GAAGC,OAAO;oBAAEQ,UAAU;gBAAK;gBAC/E,IAAIC,UAAU;oBACZ,OAAOA;gBACT;gBACA,MAAMC,UAAUpB,GAAGqB,OAAO,CAAC,aAAa;gBACxC,MAAMC,cAAc,MAAM,IAAI,CAACL,OAAO,CAACG,SAASX,UAAU;oBAAE,GAAGC,OAAO;oBAAEQ,UAAU;gBAAK;gBACvF,IAAII,aAAa;oBACf,MAAMC,SAAS/B,KAAKgC,OAAO,CAACF,YAAYtB,EAAE;oBAC1C,MAAMyB,aAAa;wBACjBjC,KAAKyB,OAAO,CAACM,QAAQ,OAAO,WAAW;wBACvC/B,KAAKyB,OAAO,CAACM,QAAQ,OAAO,WAAW;wBACvC/B,KAAKyB,OAAO,CAACM,QAAQ,QAAQ,WAAW;qBACzC;oBACD,KAAK,MAAMG,aAAaD,WAAY;wBAClC,IAAIlC,GAAGoC,UAAU,CAACD,YAAY;4BAC5B,OAAOA;wBACT;oBACF;gBACF;YACF;QACF;IACF;AACF"}
@@ -0,0 +1,19 @@
1
+ import type { PluginOption } from 'vite';
2
+ /**
3
+ * Dev-time transforms:
4
+ * - Replaces `process.cwd()` with `"/"` in client code (non-SSR, non-prebundled)
5
+ * - Injects Vite HMR + React Refresh preamble into SSR-rendered HTML (dev only)
6
+ *
7
+ * The preamble is injected just before `</head>`, *after* everything React
8
+ * renders into the head. React 19 treats `<meta>`/`<link>`/`<style>`/`<title>`
9
+ * as hoistable resources it matches by key (position-tolerant), but a
10
+ * non-hoistable inline `<script type="module">` placed *before* React's first
11
+ * rendered head node makes hydration position-match that script against a
12
+ * `<style>`/`<meta>` and throw — discarding the whole tree client-side, which
13
+ * aborts in-flight server-function fetches and intermittently breaks drawers,
14
+ * forms, and navigation. Appending after React's head content keeps the
15
+ * preamble out of that positional comparison while still running before the
16
+ * body's app-entry module.
17
+ */
18
+ export declare function payloadDevTransforms(): PluginOption;
19
+ //# sourceMappingURL=devTransforms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devTransforms.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/devTransforms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAExC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,IAAI,YAAY,CA2DnD"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Dev-time transforms:
3
+ * - Replaces `process.cwd()` with `"/"` in client code (non-SSR, non-prebundled)
4
+ * - Injects Vite HMR + React Refresh preamble into SSR-rendered HTML (dev only)
5
+ *
6
+ * The preamble is injected just before `</head>`, *after* everything React
7
+ * renders into the head. React 19 treats `<meta>`/`<link>`/`<style>`/`<title>`
8
+ * as hoistable resources it matches by key (position-tolerant), but a
9
+ * non-hoistable inline `<script type="module">` placed *before* React's first
10
+ * rendered head node makes hydration position-match that script against a
11
+ * `<style>`/`<meta>` and throw — discarding the whole tree client-side, which
12
+ * aborts in-flight server-function fetches and intermittently breaks drawers,
13
+ * forms, and navigation. Appending after React's head content keeps the
14
+ * preamble out of that positional comparison while still running before the
15
+ * body's app-entry module.
16
+ */ export function payloadDevTransforms() {
17
+ const devScripts = `<script type="module" src="/@vite/client"></script>
18
+ <script type="module">
19
+ import RefreshRuntime from "/@react-refresh"
20
+ RefreshRuntime.injectIntoGlobalHook(window)
21
+ window.$RefreshReg$ = () => {}
22
+ window.$RefreshSig$ = () => (type) => type
23
+ window.__vite_plugin_react_preamble_installed__ = true
24
+ </script>`;
25
+ return {
26
+ name: 'payload:dev-transforms',
27
+ configureServer (server) {
28
+ server.middlewares.use((_req, res, next)=>{
29
+ let injected = false;
30
+ const origWrite = res.write;
31
+ const origEnd = res.end;
32
+ function tryInject(chunk) {
33
+ if (injected || chunk == null) {
34
+ return chunk;
35
+ }
36
+ const ct = res.getHeader('content-type');
37
+ if (typeof ct !== 'string' || !ct.includes('text/html')) {
38
+ return chunk;
39
+ }
40
+ const str = typeof chunk === 'string' ? chunk : Buffer.isBuffer(chunk) ? chunk.toString() : chunk instanceof Uint8Array ? Buffer.from(chunk).toString() : null;
41
+ if (str && str.includes('</head>')) {
42
+ injected = true;
43
+ return str.replace('</head>', `${devScripts}</head>`);
44
+ }
45
+ return chunk;
46
+ }
47
+ res.write = function(chunk, encodingOrCb, cb) {
48
+ return origWrite.call(this, tryInject(chunk), encodingOrCb, cb);
49
+ };
50
+ res.end = function(chunk, encodingOrCb, cb) {
51
+ return origEnd.call(this, tryInject(chunk), encodingOrCb, cb);
52
+ };
53
+ next();
54
+ });
55
+ },
56
+ transform (code, id, options) {
57
+ if (options?.ssr) {
58
+ return;
59
+ }
60
+ if (code.includes('process.cwd') && !id.includes('node_modules/.vite')) {
61
+ return code.replace(/process\.cwd\(\)/g, '"/"');
62
+ }
63
+ }
64
+ };
65
+ }
66
+
67
+ //# sourceMappingURL=devTransforms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/vite/plugins/devTransforms.ts"],"sourcesContent":["import type { PluginOption } from 'vite'\n\n/**\n * Dev-time transforms:\n * - Replaces `process.cwd()` with `\"/\"` in client code (non-SSR, non-prebundled)\n * - Injects Vite HMR + React Refresh preamble into SSR-rendered HTML (dev only)\n *\n * The preamble is injected just before `</head>`, *after* everything React\n * renders into the head. React 19 treats `<meta>`/`<link>`/`<style>`/`<title>`\n * as hoistable resources it matches by key (position-tolerant), but a\n * non-hoistable inline `<script type=\"module\">` placed *before* React's first\n * rendered head node makes hydration position-match that script against a\n * `<style>`/`<meta>` and throw — discarding the whole tree client-side, which\n * aborts in-flight server-function fetches and intermittently breaks drawers,\n * forms, and navigation. Appending after React's head content keeps the\n * preamble out of that positional comparison while still running before the\n * body's app-entry module.\n */\nexport function payloadDevTransforms(): PluginOption {\n const devScripts = `<script type=\"module\" src=\"/@vite/client\"></script>\n<script type=\"module\">\nimport RefreshRuntime from \"/@react-refresh\"\nRefreshRuntime.injectIntoGlobalHook(window)\nwindow.$RefreshReg$ = () => {}\nwindow.$RefreshSig$ = () => (type) => type\nwindow.__vite_plugin_react_preamble_installed__ = true\n</script>`\n\n return {\n name: 'payload:dev-transforms',\n configureServer(server) {\n server.middlewares.use((_req, res, next) => {\n let injected = false\n const origWrite = res.write\n const origEnd = res.end\n\n function tryInject(chunk: any): any {\n if (injected || chunk == null) {\n return chunk\n }\n const ct = res.getHeader('content-type')\n if (typeof ct !== 'string' || !ct.includes('text/html')) {\n return chunk\n }\n const str =\n typeof chunk === 'string'\n ? chunk\n : Buffer.isBuffer(chunk)\n ? chunk.toString()\n : chunk instanceof Uint8Array\n ? Buffer.from(chunk).toString()\n : null\n if (str && str.includes('</head>')) {\n injected = true\n return str.replace('</head>', `${devScripts}</head>`)\n }\n return chunk\n }\n\n res.write = function (this: any, chunk: any, encodingOrCb?: any, cb?: any) {\n return origWrite.call(this, tryInject(chunk), encodingOrCb, cb)\n } as typeof res.write\n res.end = function (this: any, chunk?: any, encodingOrCb?: any, cb?: any) {\n return origEnd.call(this, tryInject(chunk), encodingOrCb, cb)\n } as typeof res.end\n next()\n })\n },\n transform(code, id, options) {\n if (options?.ssr) {\n return\n }\n if (code.includes('process.cwd') && !id.includes('node_modules/.vite')) {\n return code.replace(/process\\.cwd\\(\\)/g, '\"/\"')\n }\n },\n }\n}\n"],"names":["payloadDevTransforms","devScripts","name","configureServer","server","middlewares","use","_req","res","next","injected","origWrite","write","origEnd","end","tryInject","chunk","ct","getHeader","includes","str","Buffer","isBuffer","toString","Uint8Array","from","replace","encodingOrCb","cb","call","transform","code","id","options","ssr"],"mappings":"AAEA;;;;;;;;;;;;;;;CAeC,GACD,OAAO,SAASA;IACd,MAAMC,aAAa,CAAC;;;;;;;SAOb,CAAC;IAER,OAAO;QACLC,MAAM;QACNC,iBAAgBC,MAAM;YACpBA,OAAOC,WAAW,CAACC,GAAG,CAAC,CAACC,MAAMC,KAAKC;gBACjC,IAAIC,WAAW;gBACf,MAAMC,YAAYH,IAAII,KAAK;gBAC3B,MAAMC,UAAUL,IAAIM,GAAG;gBAEvB,SAASC,UAAUC,KAAU;oBAC3B,IAAIN,YAAYM,SAAS,MAAM;wBAC7B,OAAOA;oBACT;oBACA,MAAMC,KAAKT,IAAIU,SAAS,CAAC;oBACzB,IAAI,OAAOD,OAAO,YAAY,CAACA,GAAGE,QAAQ,CAAC,cAAc;wBACvD,OAAOH;oBACT;oBACA,MAAMI,MACJ,OAAOJ,UAAU,WACbA,QACAK,OAAOC,QAAQ,CAACN,SACdA,MAAMO,QAAQ,KACdP,iBAAiBQ,aACfH,OAAOI,IAAI,CAACT,OAAOO,QAAQ,KAC3B;oBACV,IAAIH,OAAOA,IAAID,QAAQ,CAAC,YAAY;wBAClCT,WAAW;wBACX,OAAOU,IAAIM,OAAO,CAAC,WAAW,GAAGzB,WAAW,OAAO,CAAC;oBACtD;oBACA,OAAOe;gBACT;gBAEAR,IAAII,KAAK,GAAG,SAAqBI,KAAU,EAAEW,YAAkB,EAAEC,EAAQ;oBACvE,OAAOjB,UAAUkB,IAAI,CAAC,IAAI,EAAEd,UAAUC,QAAQW,cAAcC;gBAC9D;gBACApB,IAAIM,GAAG,GAAG,SAAqBE,KAAW,EAAEW,YAAkB,EAAEC,EAAQ;oBACtE,OAAOf,QAAQgB,IAAI,CAAC,IAAI,EAAEd,UAAUC,QAAQW,cAAcC;gBAC5D;gBACAnB;YACF;QACF;QACAqB,WAAUC,IAAI,EAAEC,EAAE,EAAEC,OAAO;YACzB,IAAIA,SAASC,KAAK;gBAChB;YACF;YACA,IAAIH,KAAKZ,QAAQ,CAAC,kBAAkB,CAACa,GAAGb,QAAQ,CAAC,uBAAuB;gBACtE,OAAOY,KAAKL,OAAO,CAAC,qBAAqB;YAC3C;QACF;IACF;AACF"}
@@ -0,0 +1,27 @@
1
+ import type { PluginOption } from 'vite';
2
+ /**
3
+ * Provides a working `react-dom/server` inside the RSC environment.
4
+ *
5
+ * Payload's version-diff converters (`@payloadcms/richtext-lexical`'s
6
+ * `field/Diff/converters/*` and `@payloadcms/ui`'s `Version/RenderFieldsToDiff`)
7
+ * call `renderToStaticMarkup` while rendering a Server Component. In the RSC
8
+ * environment Vite activates the `react-server` export condition, under which
9
+ * every `react-dom/server*` subpath resolves to `server.react-server.js` — a
10
+ * stub that throws `react-dom/server is not supported in React Server
11
+ * Components`. Force-resolving past the condition isn't enough either: the
12
+ * static renderer reads the *client* React internals
13
+ * (`__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE`), which
14
+ * the `react-server` build of `react` doesn't expose.
15
+ *
16
+ * So we pre-bundle a self-contained `react-dom/server` with client React
17
+ * inlined (esbuild, deliberately WITHOUT the `react-server` condition) and
18
+ * redirect `react-dom/server` to it in the RSC graph only. The bundle is fully
19
+ * self-contained, so the RSC environment's `react-server` condition can't
20
+ * reach into it. JSX elements created by the RSC-graph React stay renderable
21
+ * because React identifies elements via a process-global `Symbol.for(...)`.
22
+ *
23
+ * Delete this once `react-dom/server` (or an equivalent static renderer) is
24
+ * usable from the `react-server` condition without a separate bundle.
25
+ */
26
+ export declare function reactDomServerInRsc(): PluginOption;
27
+ //# sourceMappingURL=reactDomServerInRsc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactDomServerInRsc.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/reactDomServerInRsc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAQxC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAyDlD"}