@payloadcms/tanstack-start 4.0.0-internal.4c792ad → 4.0.0-internal.5214550
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/LICENSE.md +1 -1
- package/dist/exports/vite.d.ts +2 -2
- package/dist/exports/vite.d.ts.map +1 -1
- package/dist/exports/vite.js +1 -1
- package/dist/exports/vite.js.map +1 -1
- package/dist/layouts/Root/getLayoutData.js.map +1 -1
- package/dist/layouts/Root/index.d.ts +2 -2
- package/dist/layouts/Root/index.d.ts.map +1 -1
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/routes/adminRoutes.d.ts +20 -9
- package/dist/routes/adminRoutes.d.ts.map +1 -1
- package/dist/routes/adminRoutes.js +36 -25
- package/dist/routes/adminRoutes.js.map +1 -1
- package/dist/routes/layoutRoute.d.ts +4 -1
- package/dist/routes/layoutRoute.d.ts.map +1 -1
- package/dist/routes/layoutRoute.js +7 -1
- package/dist/routes/layoutRoute.js.map +1 -1
- package/dist/utilities/loadAdminPage.d.ts +2 -12
- package/dist/utilities/loadAdminPage.d.ts.map +1 -1
- package/dist/utilities/loadAdminPage.js +13 -0
- package/dist/utilities/loadAdminPage.js.map +1 -1
- package/dist/utilities/loadLayoutData.d.ts +1 -27
- package/dist/utilities/loadLayoutData.d.ts.map +1 -1
- package/dist/utilities/loadLayoutData.js +0 -1
- package/dist/utilities/loadLayoutData.js.map +1 -1
- package/dist/vite/config/external.d.ts +11 -0
- package/dist/vite/config/external.d.ts.map +1 -0
- package/dist/vite/config/external.js +48 -0
- package/dist/vite/config/external.js.map +1 -0
- package/dist/vite/config/optimizeDeps.d.ts +25 -0
- package/dist/vite/config/optimizeDeps.d.ts.map +1 -0
- package/dist/vite/{constants.js → config/optimizeDeps.js} +9 -63
- package/dist/vite/config/optimizeDeps.js.map +1 -0
- package/dist/vite/config/scss.d.ts +14 -0
- package/dist/vite/config/scss.d.ts.map +1 -0
- package/dist/vite/config/scss.js +28 -0
- package/dist/vite/config/scss.js.map +1 -0
- package/dist/vite/importProtection.d.ts.map +1 -1
- package/dist/vite/importProtection.js +6 -2
- package/dist/vite/importProtection.js.map +1 -1
- package/dist/vite/index.d.ts +81 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +249 -0
- package/dist/vite/index.js.map +1 -0
- package/dist/vite/workarounds/clientModuleResolution.d.ts.map +1 -0
- package/dist/vite/workarounds/clientModuleResolution.js.map +1 -0
- package/dist/vite/workarounds/devTransforms.d.ts.map +1 -0
- package/dist/vite/workarounds/devTransforms.js.map +1 -0
- package/dist/vite/workarounds/reactDomServerInRsc.d.ts.map +1 -0
- package/dist/vite/workarounds/reactDomServerInRsc.js.map +1 -0
- package/dist/vite/workarounds/stripDistStyleImports.d.ts.map +1 -0
- package/dist/vite/{plugins → workarounds}/stripDistStyleImports.js +37 -4
- package/dist/vite/workarounds/stripDistStyleImports.js.map +1 -0
- package/dist/vite/workarounds/stubPrettierInClient.d.ts +21 -0
- package/dist/vite/workarounds/stubPrettierInClient.d.ts.map +1 -0
- package/dist/vite/workarounds/stubPrettierInClient.js +39 -0
- package/dist/vite/workarounds/stubPrettierInClient.js.map +1 -0
- package/dist/vite/workarounds/wrapCjsForClient.d.ts.map +1 -0
- package/dist/vite/workarounds/wrapCjsForClient.js.map +1 -0
- package/package.json +8 -10
- package/dist/@types/assets.d.js +0 -2
- package/dist/@types/assets.d.js.map +0 -1
- package/dist/vite/constants.d.ts +0 -42
- package/dist/vite/constants.d.ts.map +0 -1
- package/dist/vite/constants.js.map +0 -1
- package/dist/vite/plugin.d.ts +0 -38
- package/dist/vite/plugin.d.ts.map +0 -1
- package/dist/vite/plugin.js +0 -179
- package/dist/vite/plugin.js.map +0 -1
- package/dist/vite/plugins/clientModuleResolution.d.ts.map +0 -1
- package/dist/vite/plugins/clientModuleResolution.js.map +0 -1
- package/dist/vite/plugins/devTransforms.d.ts.map +0 -1
- package/dist/vite/plugins/devTransforms.js.map +0 -1
- package/dist/vite/plugins/reactDomServerInRsc.d.ts.map +0 -1
- package/dist/vite/plugins/reactDomServerInRsc.js.map +0 -1
- package/dist/vite/plugins/stripDistStyleImports.d.ts.map +0 -1
- package/dist/vite/plugins/stripDistStyleImports.js.map +0 -1
- package/dist/vite/plugins/wrapCjsForClient.d.ts.map +0 -1
- package/dist/vite/plugins/wrapCjsForClient.js.map +0 -1
- /package/dist/vite/{plugins → workarounds}/clientModuleResolution.d.ts +0 -0
- /package/dist/vite/{plugins → workarounds}/clientModuleResolution.js +0 -0
- /package/dist/vite/{plugins → workarounds}/devTransforms.d.ts +0 -0
- /package/dist/vite/{plugins → workarounds}/devTransforms.js +0 -0
- /package/dist/vite/{plugins → workarounds}/reactDomServerInRsc.d.ts +0 -0
- /package/dist/vite/{plugins → workarounds}/reactDomServerInRsc.js +0 -0
- /package/dist/vite/{plugins → workarounds}/stripDistStyleImports.d.ts +0 -0
- /package/dist/vite/{plugins → workarounds}/wrapCjsForClient.d.ts +0 -0
- /package/dist/vite/{plugins → workarounds}/wrapCjsForClient.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/loadLayoutData.ts"],"sourcesContent":["import type { ImportMap, SanitizedConfig } from 'payload'\n\nimport { renderServerComponent } from '@tanstack/react-start/rsc'\n\nimport { getLayoutData } from '../layouts/Root/getLayoutData.js'\nimport { toSerializable } from './toSerializable.js'\n\n
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/loadLayoutData.ts"],"sourcesContent":["import type { ImportMap, SanitizedConfig } from 'payload'\n\nimport { renderServerComponent } from '@tanstack/react-start/rsc'\n\nimport { getLayoutData } from '../layouts/Root/getLayoutData.js'\nimport { toSerializable } from './toSerializable.js'\n\n/**\n * Resolves the admin layout data for TanStack Start and returns a serializable\n * payload for the `/_payload` route loader. The framework adapter wraps this in\n * a `createServerFn` that supplies the app's `config` and generated `importMap`.\n *\n * `toSerializable` strips React elements, so the custom-providers element tree\n * (`config.admin.components.providers`) is rendered to an RSC payload separately\n * and re-attached.\n */\nexport async function loadLayoutData({\n config,\n importMap,\n}: {\n config: SanitizedConfig\n importMap: ImportMap\n}): Promise<Record<string, unknown>> {\n const { providers, ...data } = await getLayoutData({ configPromise: config, importMap })\n\n return {\n ...(toSerializable(data) as Record<string, unknown>),\n providers: providers ? await renderServerComponent(providers as any) : undefined,\n }\n}\n"],"names":["renderServerComponent","getLayoutData","toSerializable","loadLayoutData","config","importMap","providers","data","configPromise","undefined"],"mappings":"AAEA,SAASA,qBAAqB,QAAQ,4BAA2B;AAEjE,SAASC,aAAa,QAAQ,mCAAkC;AAChE,SAASC,cAAc,QAAQ,sBAAqB;AAEpD;;;;;;;;CAQC,GACD,OAAO,eAAeC,eAAe,EACnCC,MAAM,EACNC,SAAS,EAIV;IACC,MAAM,EAAEC,SAAS,EAAE,GAAGC,MAAM,GAAG,MAAMN,cAAc;QAAEO,eAAeJ;QAAQC;IAAU;IAEtF,OAAO;QACL,GAAIH,eAAeK,KAAK;QACxBD,WAAWA,YAAY,MAAMN,sBAAsBM,aAAoBG;IACzE;AACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SSR/RSC externalization config used by `withPayload`. Kept separate from the
|
|
3
|
+
* client optimizer config (`./optimizeDeps.ts`) so each concern stays small.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Server-only packages (Node-only or only ever used by the server bundle).
|
|
7
|
+
* These are the Vite equivalent of Next.js's `serverExternalPackages`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ssrExternalPackages: string[];
|
|
10
|
+
export declare const payloadNoExternalPatterns: Array<RegExp | string>;
|
|
11
|
+
//# sourceMappingURL=external.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external.d.ts","sourceRoot":"","sources":["../../../src/vite/config/external.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,EA+BvC,CAAA;AAED,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAO5D,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SSR/RSC externalization config used by `withPayload`. Kept separate from the
|
|
3
|
+
* client optimizer config (`./optimizeDeps.ts`) so each concern stays small.
|
|
4
|
+
*/ /**
|
|
5
|
+
* Server-only packages (Node-only or only ever used by the server bundle).
|
|
6
|
+
* These are the Vite equivalent of Next.js's `serverExternalPackages`.
|
|
7
|
+
*/ export const ssrExternalPackages = [
|
|
8
|
+
'ajv',
|
|
9
|
+
'fast-uri',
|
|
10
|
+
'drizzle-kit',
|
|
11
|
+
'drizzle-kit/api',
|
|
12
|
+
'drizzle-orm',
|
|
13
|
+
'sharp',
|
|
14
|
+
'require-in-the-middle',
|
|
15
|
+
'json-schema-to-typescript',
|
|
16
|
+
'pino',
|
|
17
|
+
'pino-pretty',
|
|
18
|
+
'graphql',
|
|
19
|
+
'nodemailer',
|
|
20
|
+
'aws4',
|
|
21
|
+
'pluralize',
|
|
22
|
+
'console-table-printer',
|
|
23
|
+
'@azure/storage-blob',
|
|
24
|
+
'@aws-sdk/client-s3',
|
|
25
|
+
'@aws-sdk/s3-request-presigner',
|
|
26
|
+
'@google-cloud/storage',
|
|
27
|
+
// Database drivers + their lazily-required companions, one group per adapter.
|
|
28
|
+
// Postgres (`@payloadcms/db-postgres`, `@payloadcms/db-vercel-postgres`)
|
|
29
|
+
'pg',
|
|
30
|
+
'pg-native',
|
|
31
|
+
'pg-cloudflare',
|
|
32
|
+
// SQLite (`@payloadcms/db-sqlite`)
|
|
33
|
+
'better-sqlite3',
|
|
34
|
+
'libsql',
|
|
35
|
+
// Mongo (`@payloadcms/db-mongodb`)
|
|
36
|
+
'mongodb',
|
|
37
|
+
'mongoose'
|
|
38
|
+
];
|
|
39
|
+
export const payloadNoExternalPatterns = [
|
|
40
|
+
'@payloadcms/ui',
|
|
41
|
+
'@payloadcms/translations',
|
|
42
|
+
'@payloadcms/tanstack-start',
|
|
43
|
+
/^@payloadcms\/richtext-lexical/,
|
|
44
|
+
/^@payloadcms\/plugin-/,
|
|
45
|
+
/^@payloadcms\/storage-/
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=external.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/vite/config/external.ts"],"sourcesContent":["/**\n * SSR/RSC externalization config used by `withPayload`. Kept separate from the\n * client optimizer config (`./optimizeDeps.ts`) so each concern stays small.\n */\n\n/**\n * Server-only packages (Node-only or only ever used by the server bundle).\n * These are the Vite equivalent of Next.js's `serverExternalPackages`.\n */\nexport const ssrExternalPackages: string[] = [\n 'ajv',\n 'fast-uri',\n 'drizzle-kit',\n 'drizzle-kit/api',\n 'drizzle-orm',\n 'sharp',\n 'require-in-the-middle',\n 'json-schema-to-typescript',\n 'pino',\n 'pino-pretty',\n 'graphql',\n 'nodemailer',\n 'aws4',\n 'pluralize',\n 'console-table-printer',\n '@azure/storage-blob',\n '@aws-sdk/client-s3',\n '@aws-sdk/s3-request-presigner',\n '@google-cloud/storage',\n // Database drivers + their lazily-required companions, one group per adapter.\n // Postgres (`@payloadcms/db-postgres`, `@payloadcms/db-vercel-postgres`)\n 'pg',\n 'pg-native',\n 'pg-cloudflare',\n // SQLite (`@payloadcms/db-sqlite`)\n 'better-sqlite3',\n 'libsql',\n // Mongo (`@payloadcms/db-mongodb`)\n 'mongodb',\n 'mongoose',\n]\n\nexport const payloadNoExternalPatterns: Array<RegExp | string> = [\n '@payloadcms/ui',\n '@payloadcms/translations',\n '@payloadcms/tanstack-start',\n /^@payloadcms\\/richtext-lexical/,\n /^@payloadcms\\/plugin-/,\n /^@payloadcms\\/storage-/,\n]\n"],"names":["ssrExternalPackages","payloadNoExternalPatterns"],"mappings":"AAAA;;;CAGC,GAED;;;CAGC,GACD,OAAO,MAAMA,sBAAgC;IAC3C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,8EAA8E;IAC9E,yEAAyE;IACzE;IACA;IACA;IACA,mCAAmC;IACnC;IACA;IACA,mCAAmC;IACnC;IACA;CACD,CAAA;AAED,OAAO,MAAMC,4BAAoD;IAC/D;IACA;IACA;IACA;IACA;IACA;CACD,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client dep-optimizer config used by `withPayload`. Kept separate from the
|
|
3
|
+
* SSR/RSC externalization config (`./external.ts`) so each concern stays small.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Packages we know contain Node-only code or top-level side effects requiring
|
|
7
|
+
* Node APIs. Excluding them from the client optimizer prevents Vite from
|
|
8
|
+
* walking into their main entries and trying to bundle server-only imports
|
|
9
|
+
* for the browser.
|
|
10
|
+
*/
|
|
11
|
+
export declare const optimizeDepsExcludeDefaults: string[];
|
|
12
|
+
/**
|
|
13
|
+
* Transitive dependencies of `@payloadcms/ui` and `payload` that need to be
|
|
14
|
+
* pre-bundled for the client. Vite's auto-discovery doesn't reliably pick
|
|
15
|
+
* these up because their parent packages are in `optimizeDeps.exclude`, so we
|
|
16
|
+
* list them explicitly using the `parent > child` syntax.
|
|
17
|
+
*
|
|
18
|
+
* Each entry below fixes a specific late-discovery re-optimization: without it,
|
|
19
|
+
* Vite discovers the dep *after* its initial crawl, forcing a full dep
|
|
20
|
+
* re-optimization mid-session that 404s in-flight `.vite/deps/*` chunks and
|
|
21
|
+
* remounts the admin (dropping client state). This is why the list can't simply
|
|
22
|
+
* be deleted — it is the "complete first pass" for the admin's dep graph.
|
|
23
|
+
*/
|
|
24
|
+
export declare const optimizeDepsIncludeDefaults: string[];
|
|
25
|
+
//# sourceMappingURL=optimizeDeps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optimizeDeps.d.ts","sourceRoot":"","sources":["../../../src/vite/config/optimizeDeps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,EAsB/C,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,EA8E/C,CAAA"}
|
|
@@ -1,67 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Client dep-optimizer config used by `withPayload`. Kept separate from the
|
|
3
|
+
* SSR/RSC externalization config (`./external.ts`) so each concern stays small.
|
|
4
4
|
*/ /**
|
|
5
|
-
* Server-only packages (Node-only or only ever used by the server bundle).
|
|
6
|
-
* These are the Vite equivalent of Next.js's `serverExternalPackages`.
|
|
7
|
-
*/ export const ssrExternalPackages = [
|
|
8
|
-
'ajv',
|
|
9
|
-
'fast-uri',
|
|
10
|
-
'drizzle-kit',
|
|
11
|
-
'drizzle-kit/api',
|
|
12
|
-
'drizzle-orm',
|
|
13
|
-
'sharp',
|
|
14
|
-
'libsql',
|
|
15
|
-
'require-in-the-middle',
|
|
16
|
-
'json-schema-to-typescript',
|
|
17
|
-
'pino',
|
|
18
|
-
'pino-pretty',
|
|
19
|
-
'graphql',
|
|
20
|
-
'mongodb',
|
|
21
|
-
'mongoose',
|
|
22
|
-
'better-sqlite3',
|
|
23
|
-
'pg',
|
|
24
|
-
'pg-native',
|
|
25
|
-
'nodemailer',
|
|
26
|
-
'aws4',
|
|
27
|
-
'pluralize',
|
|
28
|
-
'console-table-printer',
|
|
29
|
-
'@azure/storage-blob',
|
|
30
|
-
'@aws-sdk/client-s3',
|
|
31
|
-
'@aws-sdk/s3-request-presigner',
|
|
32
|
-
'@google-cloud/storage'
|
|
33
|
-
];
|
|
34
|
-
/**
|
|
35
|
-
* Payload packages whose source must be processed by Vite even on the server
|
|
36
|
-
* (because they are workspace `.ts` files in dev). Server-only adapters
|
|
37
|
-
* (`@payloadcms/db-*`, `@payloadcms/email-*`, `@payloadcms/next`, etc.) are
|
|
38
|
-
* intentionally not included — those should stay external on the SSR side.
|
|
39
|
-
*/ export const payloadNoExternalPatterns = [
|
|
40
|
-
'@payloadcms/ui',
|
|
41
|
-
'@payloadcms/translations',
|
|
42
|
-
'@payloadcms/tanstack-start',
|
|
43
|
-
/^@payloadcms\/richtext-lexical/,
|
|
44
|
-
/^@payloadcms\/plugin-/,
|
|
45
|
-
/^@payloadcms\/storage-/
|
|
46
|
-
];
|
|
47
|
-
/**
|
|
48
|
-
* The subset of `payloadNoExternalPatterns` that needs to participate in the
|
|
49
|
-
* RSC environment. Plugins and storage adapters must be included: they register
|
|
50
|
-
* custom providers/components (e.g. `plugin-multi-tenant`'s `'use client'`
|
|
51
|
-
* `TenantSelectionProvider`) that render in the RSC graph via
|
|
52
|
-
* `RenderServerComponent`. If the package stays external to RSC, `plugin-rsc`
|
|
53
|
-
* never transforms its `'use client'` modules into client references, so the
|
|
54
|
-
* component executes server-side and crashes on the first hook
|
|
55
|
-
* (`Cannot read properties of null (reading 'useState')`).
|
|
56
|
-
*/ export const payloadRscNoExternalPatterns = [
|
|
57
|
-
'@payloadcms/ui',
|
|
58
|
-
'@payloadcms/translations',
|
|
59
|
-
'@payloadcms/tanstack-start',
|
|
60
|
-
/^@payloadcms\/richtext-lexical/,
|
|
61
|
-
/^@payloadcms\/plugin-/,
|
|
62
|
-
/^@payloadcms\/storage-/
|
|
63
|
-
];
|
|
64
|
-
/**
|
|
65
5
|
* Packages we know contain Node-only code or top-level side effects requiring
|
|
66
6
|
* Node APIs. Excluding them from the client optimizer prevents Vite from
|
|
67
7
|
* walking into their main entries and trying to bundle server-only imports
|
|
@@ -94,6 +34,12 @@
|
|
|
94
34
|
* pre-bundled for the client. Vite's auto-discovery doesn't reliably pick
|
|
95
35
|
* these up because their parent packages are in `optimizeDeps.exclude`, so we
|
|
96
36
|
* list them explicitly using the `parent > child` syntax.
|
|
37
|
+
*
|
|
38
|
+
* Each entry below fixes a specific late-discovery re-optimization: without it,
|
|
39
|
+
* Vite discovers the dep *after* its initial crawl, forcing a full dep
|
|
40
|
+
* re-optimization mid-session that 404s in-flight `.vite/deps/*` chunks and
|
|
41
|
+
* remounts the admin (dropping client state). This is why the list can't simply
|
|
42
|
+
* be deleted — it is the "complete first pass" for the admin's dep graph.
|
|
97
43
|
*/ export const optimizeDepsIncludeDefaults = [
|
|
98
44
|
'@payloadcms/ui > sonner',
|
|
99
45
|
'@payloadcms/ui > @faceless-ui/modal',
|
|
@@ -174,4 +120,4 @@
|
|
|
174
120
|
'payload > sanitize-filename'
|
|
175
121
|
];
|
|
176
122
|
|
|
177
|
-
//# sourceMappingURL=
|
|
123
|
+
//# sourceMappingURL=optimizeDeps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/vite/config/optimizeDeps.ts"],"sourcesContent":["/**\n * Client dep-optimizer config used by `withPayload`. Kept separate from the\n * SSR/RSC externalization config (`./external.ts`) so each concern stays small.\n */\n\n/**\n * Packages we know contain Node-only code or top-level side effects requiring\n * Node APIs. Excluding them from the client optimizer prevents Vite from\n * walking into their main entries and trying to bundle server-only imports\n * for the browser.\n */\nexport const optimizeDepsExcludeDefaults: string[] = [\n 'sharp',\n '@payloadcms/ui',\n '@payloadcms/tanstack-start',\n 'payload',\n 'pino',\n 'pino-pretty',\n 'busboy',\n 'get-tsconfig',\n 'ws',\n 'croner',\n 'prompts',\n 'file-type',\n // Server-only SDKs used by `@payloadcms/storage-*` adapters. Vite\n // sometimes walks these from the main package entry while scanning\n // workspace deps, and the browser sub-bundles do not expose the\n // server-only APIs (e.g. `BlobSASPermissions`), which crashes the dev\n // server with a `MISSING_EXPORT` error before any test runs.\n '@azure/storage-blob',\n '@aws-sdk/client-s3',\n '@aws-sdk/s3-request-presigner',\n '@google-cloud/storage',\n]\n\n/**\n * Transitive dependencies of `@payloadcms/ui` and `payload` that need to be\n * pre-bundled for the client. Vite's auto-discovery doesn't reliably pick\n * these up because their parent packages are in `optimizeDeps.exclude`, so we\n * list them explicitly using the `parent > child` syntax.\n *\n * Each entry below fixes a specific late-discovery re-optimization: without it,\n * Vite discovers the dep *after* its initial crawl, forcing a full dep\n * re-optimization mid-session that 404s in-flight `.vite/deps/*` chunks and\n * remounts the admin (dropping client state). This is why the list can't simply\n * be deleted — it is the \"complete first pass\" for the admin's dep graph.\n */\nexport const optimizeDepsIncludeDefaults: string[] = [\n '@payloadcms/ui > sonner',\n '@payloadcms/ui > @faceless-ui/modal',\n '@payloadcms/ui > @faceless-ui/window-info',\n '@payloadcms/ui > @faceless-ui/scroll-info',\n '@payloadcms/ui > @dnd-kit/core',\n '@payloadcms/ui > @dnd-kit/sortable',\n '@payloadcms/ui > @dnd-kit/utilities',\n '@payloadcms/ui > react-datepicker',\n '@payloadcms/ui > react-select',\n '@payloadcms/ui > react-select/creatable',\n '@payloadcms/ui > react-image-crop',\n '@payloadcms/ui > @monaco-editor/react',\n '@payloadcms/ui > date-fns',\n '@payloadcms/ui > date-fns/transpose',\n '@payloadcms/ui > @date-fns/tz/date/mini',\n '@payloadcms/ui > uuid',\n '@payloadcms/ui > use-context-selector',\n '@payloadcms/ui > bson-objectid',\n '@payloadcms/ui > dequal',\n '@payloadcms/ui > object-to-formdata',\n '@payloadcms/ui > md5',\n 'payload > deepmerge',\n 'payload > pluralize',\n // `scheduler` is a transitive dep of `react-dom`, not a direct dependency of\n // the app, so a bare `'scheduler'` specifier fails to resolve from an isolated\n // install (`test/node_modules` built with `pnpm i --ignore-workspace`), where\n // it isn't hoisted to the top level. Path it through `react-dom` so the\n // optimizer resolves the exact copy the runtime loads.\n 'react-dom > scheduler',\n // `@payloadcms/ui` (in `optimizeDeps.exclude`) ships compiled output that the\n // React Compiler rewrote to `import { c } from 'react/compiler-runtime'`.\n // Because its parent is excluded, the optimizer never crawls in to discover\n // this entry, so Vite serves `react/compiler-runtime` raw. That file is\n // CommonJS (`module.exports = require(...)`), so the named `c` export can't be\n // statically extracted and every client component throws \"does not provide an\n // export named 'c'\". Pre-bundling it lets esbuild synthesize the named export.\n 'react/compiler-runtime',\n // Transitive deps that Vite otherwise discovers *after* the initial crawl\n // (react-select pulls in @floating-ui at runtime; react-is is reached via\n // react-transition-group/prop-types; the default date-fns locale is loaded\n // through a dynamic `date-fns/locale/${key}` import). A late discovery forces\n // a full dep re-optimization mid-session, which 404s every in-flight\n // `.vite/deps/*` chunk (\"Pre-transform error: file does not exist in the\n // optimize deps directory\") and breaks the admin UI in CI cold starts.\n // Pre-bundling them keeps the first optimization pass complete.\n '@payloadcms/ui > react-select > @floating-ui/dom',\n '@payloadcms/ui > react-select > @floating-ui/dom > @floating-ui/core',\n '@payloadcms/ui > react-select > prop-types > react-is',\n '@payloadcms/ui > date-fns/locale/en-US',\n // Further late discoveries observed re-optimizing mid-run in CI cold starts\n // (see CI logs: \"✨ new dependencies optimized: @dnd-kit/modifiers / ajv /\n // dequal/lite\"). The modular dashboard pulls in `@dnd-kit/modifiers` on first\n // render; form-state diffing reaches `dequal/lite` (a distinct entry point\n // from the already-listed `dequal`); client-side field validation reaches\n // `ajv` *through `payload`* — it is `ssrExternal` server-side but still\n // bundled into the client, and must be pathed via `payload` so the optimizer\n // pre-bundles the exact copy the runtime loads.\n '@payloadcms/ui > @dnd-kit/modifiers',\n '@payloadcms/ui > dequal/lite',\n 'payload > ajv',\n // The storage client-upload suites (esp. vercel-blob) crawl part of the\n // `payload` server runtime into the client bundle and discover these late,\n // triggering several \"optimized dependencies changed. reloading\" waves that\n // reload the page mid-test (the bulk-upload drawer's Create New button /\n // dropzone vanish and the direct-to-bucket PUT never fires). Pre-bundle the\n // whole observed set so the first pass is complete.\n 'payload > undici',\n 'payload > jose',\n 'payload > dataloader',\n 'payload > path-to-regexp',\n 'payload > console-table-printer',\n 'payload > ci-info',\n 'payload > image-size',\n 'payload > image-size/fromFile',\n 'payload > ipaddr.js',\n 'payload > range-parser',\n 'payload > sanitize-filename',\n]\n"],"names":["optimizeDepsExcludeDefaults","optimizeDepsIncludeDefaults"],"mappings":"AAAA;;;CAGC,GAED;;;;;CAKC,GACD,OAAO,MAAMA,8BAAwC;IACnD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,kEAAkE;IAClE,mEAAmE;IACnE,gEAAgE;IAChE,sEAAsE;IACtE,6DAA6D;IAC7D;IACA;IACA;IACA;CACD,CAAA;AAED;;;;;;;;;;;CAWC,GACD,OAAO,MAAMC,8BAAwC;IACnD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,6EAA6E;IAC7E,+EAA+E;IAC/E,8EAA8E;IAC9E,wEAAwE;IACxE,uDAAuD;IACvD;IACA,8EAA8E;IAC9E,0EAA0E;IAC1E,4EAA4E;IAC5E,wEAAwE;IACxE,+EAA+E;IAC/E,8EAA8E;IAC9E,+EAA+E;IAC/E;IACA,0EAA0E;IAC1E,0EAA0E;IAC1E,2EAA2E;IAC3E,8EAA8E;IAC9E,qEAAqE;IACrE,yEAAyE;IACzE,uEAAuE;IACvE,gEAAgE;IAChE;IACA;IACA;IACA;IACA,4EAA4E;IAC5E,0EAA0E;IAC1E,8EAA8E;IAC9E,2EAA2E;IAC3E,0EAA0E;IAC1E,wEAAwE;IACxE,6EAA6E;IAC7E,gDAAgD;IAChD;IACA;IACA;IACA,wEAAwE;IACxE,2EAA2E;IAC3E,4EAA4E;IAC5E,yEAAyE;IACzE,4EAA4E;IAC5E,oDAAoD;IACpD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SCSS `@import`/`@use` importers applied for every Payload consumer.
|
|
3
|
+
*
|
|
4
|
+
* Resolves webpack-style `~@payloadcms/...` tilde specifiers (emitted by
|
|
5
|
+
* first-party Payload package styles, e.g. `@payloadcms/richtext-slate`) to the
|
|
6
|
+
* installed package via Node resolution. Because it goes through the package's
|
|
7
|
+
* `exports` map, it picks the workspace `src` scss in the monorepo and the
|
|
8
|
+
* published `dist` scss in a consumer install automatically — no per-app
|
|
9
|
+
* `findFileUrl` shim needed.
|
|
10
|
+
*/
|
|
11
|
+
export declare const payloadScssImporters: {
|
|
12
|
+
findFileUrl(url: string): null | URL;
|
|
13
|
+
}[];
|
|
14
|
+
//# sourceMappingURL=scss.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scss.d.ts","sourceRoot":"","sources":["../../../src/vite/config/scss.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB;qBAEZ,MAAM,GAAG,IAAI,GAAG,GAAG;GAWvC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
import { pathToFileURL } from 'node:url';
|
|
3
|
+
const require = createRequire(import.meta.url);
|
|
4
|
+
/**
|
|
5
|
+
* SCSS `@import`/`@use` importers applied for every Payload consumer.
|
|
6
|
+
*
|
|
7
|
+
* Resolves webpack-style `~@payloadcms/...` tilde specifiers (emitted by
|
|
8
|
+
* first-party Payload package styles, e.g. `@payloadcms/richtext-slate`) to the
|
|
9
|
+
* installed package via Node resolution. Because it goes through the package's
|
|
10
|
+
* `exports` map, it picks the workspace `src` scss in the monorepo and the
|
|
11
|
+
* published `dist` scss in a consumer install automatically — no per-app
|
|
12
|
+
* `findFileUrl` shim needed.
|
|
13
|
+
*/ export const payloadScssImporters = [
|
|
14
|
+
{
|
|
15
|
+
findFileUrl (url) {
|
|
16
|
+
if (!url.startsWith('~@payloadcms/')) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
return pathToFileURL(require.resolve(url.slice(1)));
|
|
21
|
+
} catch {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/vite/config/scss.ts"],"sourcesContent":["import { createRequire } from 'node:module'\nimport { pathToFileURL } from 'node:url'\n\nconst require = createRequire(import.meta.url)\n\n/**\n * SCSS `@import`/`@use` importers applied for every Payload consumer.\n *\n * Resolves webpack-style `~@payloadcms/...` tilde specifiers (emitted by\n * first-party Payload package styles, e.g. `@payloadcms/richtext-slate`) to the\n * installed package via Node resolution. Because it goes through the package's\n * `exports` map, it picks the workspace `src` scss in the monorepo and the\n * published `dist` scss in a consumer install automatically — no per-app\n * `findFileUrl` shim needed.\n */\nexport const payloadScssImporters = [\n {\n findFileUrl(url: string): null | URL {\n if (!url.startsWith('~@payloadcms/')) {\n return null\n }\n try {\n return pathToFileURL(require.resolve(url.slice(1)))\n } catch {\n return null\n }\n },\n },\n]\n"],"names":["createRequire","pathToFileURL","require","url","payloadScssImporters","findFileUrl","startsWith","resolve","slice"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAa;AAC3C,SAASC,aAAa,QAAQ,WAAU;AAExC,MAAMC,UAAUF,cAAc,YAAYG,GAAG;AAE7C;;;;;;;;;CASC,GACD,OAAO,MAAMC,uBAAuB;IAClC;QACEC,aAAYF,GAAW;YACrB,IAAI,CAACA,IAAIG,UAAU,CAAC,kBAAkB;gBACpC,OAAO;YACT;YACA,IAAI;gBACF,OAAOL,cAAcC,QAAQK,OAAO,CAACJ,IAAIK,KAAK,CAAC;YACjD,EAAE,OAAM;gBACN,OAAO;YACT;QACF;IACF;CACD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importProtection.d.ts","sourceRoot":"","sources":["../../src/vite/importProtection.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAoB7D,CAAA;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"importProtection.d.ts","sourceRoot":"","sources":["../../src/vite/importProtection.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAoB7D,CAAA;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAwC9E;AAED,eAAO,MAAM,sCAAsC,EAAE,MAAM,EAAsC,CAAA"}
|
|
@@ -30,8 +30,12 @@ import { builtinModules } from 'node:module';
|
|
|
30
30
|
* to permit even when they appear to cross a server/client boundary.
|
|
31
31
|
*/ export function onImportProtectionViolation(violation) {
|
|
32
32
|
const info = violation;
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
// Payload's `.client.*` components must be server-rendered, so exempt them from
|
|
34
|
+
// TanStack's default `**/*.client.*` SSR denial. Matched by resolved path
|
|
35
|
+
// (installed and linked/monorepo) so a host's own `.client.*` files stay
|
|
36
|
+
// protected.
|
|
37
|
+
const payloadClientFile = /@payloadcms\/|\/packages\/(?:ui|richtext-lexical|richtext-slate|plugin-[^/]+)\//;
|
|
38
|
+
if (info.envType === 'server' && info.resolved?.includes('.client.') && payloadClientFile.test(info.resolved)) {
|
|
35
39
|
return false;
|
|
36
40
|
}
|
|
37
41
|
if (info.importer.includes('/richtext-lexical/') && info.importer.includes('/field/Diff/')) {
|
|
@@ -1 +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
|
|
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 // Payload's `.client.*` components must be server-rendered, so exempt them from\n // TanStack's default `**/*.client.*` SSR denial. Matched by resolved path\n // (installed and linked/monorepo) so a host's own `.client.*` files stay\n // protected.\n const payloadClientFile =\n /@payloadcms\\/|\\/packages\\/(?:ui|richtext-lexical|richtext-slate|plugin-[^/]+)\\//\n\n if (\n info.envType === 'server' &&\n info.resolved?.includes('.client.') &&\n payloadClientFile.test(info.resolved)\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","payloadClientFile","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,gFAAgF;IAChF,0EAA0E;IAC1E,yEAAyE;IACzE,aAAa;IACb,MAAME,oBACJ;IAEF,IACED,KAAKE,OAAO,KAAK,YACjBF,KAAKG,QAAQ,EAAEC,SAAS,eACxBH,kBAAkBI,IAAI,CAACL,KAAKG,QAAQ,GACpC;QACA,OAAO;IACT;IAEA,IAAIH,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,81 @@
|
|
|
1
|
+
import type { ConfigEnv, UserConfig, UserConfigFnObject } from 'vite';
|
|
2
|
+
import { tanstackStart } from '@tanstack/react-start/plugin/vite';
|
|
3
|
+
import viteReact from '@vitejs/plugin-react';
|
|
4
|
+
import rsc from '@vitejs/plugin-rsc';
|
|
5
|
+
export type WithPayloadOptions = {
|
|
6
|
+
/** Extra import-protection `ignoreImporters` patterns for the TanStack Start plugin. */
|
|
7
|
+
additionalIgnoreImporters?: RegExp[];
|
|
8
|
+
/** Path to the user's `payload.config.ts` (required) */
|
|
9
|
+
payloadConfigPath: string;
|
|
10
|
+
/** TanStack router routes directory relative to `srcDirectory`. Defaults to `'app'` */
|
|
11
|
+
routesDirectory?: string;
|
|
12
|
+
/** Silence Vite warnings about third-party dependency sourcemaps. Defaults to `true`. */
|
|
13
|
+
silenceDependencyWarnings?: boolean;
|
|
14
|
+
/** TanStack source directory. Defaults to `'src'` */
|
|
15
|
+
srcDirectory?: string;
|
|
16
|
+
/** Extra Vite config deep-merged over the Payload defaults. Ignored in `build` mode. */
|
|
17
|
+
vite?: UserConfig;
|
|
18
|
+
};
|
|
19
|
+
/** The options Payload's admin requires for each third-party plugin. */
|
|
20
|
+
export type PayloadPluginOptions = {
|
|
21
|
+
react: NonNullable<Parameters<typeof viteReact>[0]>;
|
|
22
|
+
rsc: NonNullable<Parameters<typeof rsc>[0]>;
|
|
23
|
+
tanstackStart: NonNullable<Parameters<typeof tanstackStart>[0]>;
|
|
24
|
+
};
|
|
25
|
+
export type WithPayloadBuilderContext = {
|
|
26
|
+
/** Payload's base Vite config; `plugins` holds Payload's workaround plugins only. */
|
|
27
|
+
config: UserConfig;
|
|
28
|
+
env: ConfigEnv;
|
|
29
|
+
/** Options to pass to the `viteReact`/`rsc`/`tanstackStart` factories you import. */
|
|
30
|
+
pluginOptions: PayloadPluginOptions;
|
|
31
|
+
};
|
|
32
|
+
/** Assembles the final Vite config from Payload's base config and plugin options. */
|
|
33
|
+
export type WithPayloadBuilder = (context: WithPayloadBuilderContext) => UserConfig;
|
|
34
|
+
/**
|
|
35
|
+
* Vite config helper for Payload + TanStack Start; the counterpart to Next.js'
|
|
36
|
+
* `withPayload`.
|
|
37
|
+
*
|
|
38
|
+
* Zero-config — Payload instantiates the RSC, React, and TanStack Start plugins:
|
|
39
|
+
*
|
|
40
|
+
* ```ts
|
|
41
|
+
* export default withPayload({ payloadConfigPath: './src/payload.config.ts' })
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* Guest mode — pass a `build` callback to instantiate them yourself (one copy of
|
|
45
|
+
* each; `@vitejs/plugin-rsc` is a hard singleton):
|
|
46
|
+
*
|
|
47
|
+
* ```ts
|
|
48
|
+
* export default withPayload(
|
|
49
|
+
* { payloadConfigPath: './src/payload.config.ts' },
|
|
50
|
+
* ({ config, pluginOptions }) => ({
|
|
51
|
+
* ...config,
|
|
52
|
+
* plugins: [
|
|
53
|
+
* ...config.plugins,
|
|
54
|
+
* rsc(pluginOptions.rsc),
|
|
55
|
+
* tanstackStart(pluginOptions.tanstackStart),
|
|
56
|
+
* viteReact(pluginOptions.react),
|
|
57
|
+
* ],
|
|
58
|
+
* }),
|
|
59
|
+
* )
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare function withPayload(options: WithPayloadOptions, build?: WithPayloadBuilder): UserConfigFnObject;
|
|
63
|
+
/** `@vitejs/plugin-rsc` options for Payload: `serverHandler: false` (TanStack owns the handler). */
|
|
64
|
+
export declare function payloadRscOptions(): NonNullable<Parameters<typeof rsc>[0]>;
|
|
65
|
+
/** `@vitejs/plugin-react` options for Payload: transform every `.[jt]sx?` file. */
|
|
66
|
+
export declare function payloadReactOptions(): NonNullable<Parameters<typeof viteReact>[0]>;
|
|
67
|
+
export type PayloadTanstackStartOptionsArgs = {
|
|
68
|
+
/** Additional import-protection `ignoreImporters` patterns. */
|
|
69
|
+
additionalIgnoreImporters?: RegExp[];
|
|
70
|
+
/** TanStack router routes directory relative to `srcDirectory`. Defaults to `'app'`. */
|
|
71
|
+
routesDirectory?: string;
|
|
72
|
+
/** TanStack source directory. Defaults to `'src'`. */
|
|
73
|
+
srcDirectory?: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* The `tanstackStart` options Payload's admin requires (import-protection and
|
|
77
|
+
* code-splitting). TanStack Start is one-per-app, so a host that already runs it
|
|
78
|
+
* should merge these into its single `tanstackStart` call.
|
|
79
|
+
*/
|
|
80
|
+
export declare function payloadTanstackStartOptions(args?: PayloadTanstackStartOptionsArgs): NonNullable<Parameters<typeof tanstackStart>[0]>;
|
|
81
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAwB,UAAU,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAA;AAE3F,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AACjE,OAAO,SAAS,MAAM,sBAAsB,CAAA;AAC5C,OAAO,GAAG,MAAM,oBAAoB,CAAA;AA0DpC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,wFAAwF;IACxF,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAA;IACpC,wDAAwD;IACxD,iBAAiB,EAAE,MAAM,CAAA;IACzB,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,yFAAyF;IACzF,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wFAAwF;IACxF,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB,CAAA;AAED,wEAAwE;AACxE,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACnD,GAAG,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3C,aAAa,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;CAChE,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,qFAAqF;IACrF,MAAM,EAAE,UAAU,CAAA;IAClB,GAAG,EAAE,SAAS,CAAA;IACd,qFAAqF;IACrF,aAAa,EAAE,oBAAoB,CAAA;CACpC,CAAA;AAED,qFAAqF;AACrF,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,yBAAyB,KAAK,UAAU,CAAA;AAEnF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,kBAAkB,EAC3B,KAAK,CAAC,EAAE,kBAAkB,GACzB,kBAAkB,CAiGpB;AAED,oGAAoG;AACpG,wBAAgB,iBAAiB,IAAI,WAAW,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAE1E;AAED,mFAAmF;AACnF,wBAAgB,mBAAmB,IAAI,WAAW,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAElF;AAED,MAAM,MAAM,+BAA+B,GAAG;IAC5C,+DAA+D;IAC/D,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAA;IACpC,wFAAwF;IACxF,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,GAAE,+BAAoC,GACzC,WAAW,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CA8BlD"}
|