@payloadcms/next 4.0.0-internal.d3909a9 → 4.0.0-internal.d7d662c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/UnmountWhenHidden/index.js.map +1 -1
- package/dist/adapters/router.js +58 -21
- package/dist/adapters/router.js.map +1 -1
- package/dist/cjs/withPayload.cjs +40 -56
- package/dist/cjs/withPayload.cjs.map +4 -4
- package/dist/prod/styles.css +1 -1
- package/dist/withPayload/withPayload.d.ts.map +1 -1
- package/dist/withPayload/withPayload.js +3 -31
- package/dist/withPayload/withPayload.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","useRouter","React","useLayoutEffect","useState","UnmountWhenHidden","t0","$","children","bfcacheId","t1","_jsx","RenderNothingWhileHidden","isVisible","setIsVisible","t2","Symbol","for"],"sources":["../../../src/adapters/UnmountWhenHidden/index.tsx"],"sourcesContent":["'use client'\nimport { useRouter } from 'next/navigation.js'\nimport React, { useLayoutEffect, useState } from 'react'\n\n/**\n * With `cacheComponents`, Next.js does not unmount pages you navigate away from. It keeps the last\n * few inside a hidden React `<Activity>` boundary so going back can restore them. In the admin\n * panel, that leaves hidden copies of previous views in the DOM (duplicate element IDs, old client\n * state) and breaks selectors that expect a single match.\n *\n * React runs effect cleanups when an `<Activity>` boundary is hidden. This component uses that to\n * render nothing while hidden, so the view is mounted fresh when it becomes visible again, like it\n * is without `cacheComponents`. Only rendered when `cacheComponents` is enabled.\n *\n * @see https://github.com/vercel/next.js/issues/86577\n * @see https://react.dev/reference/react/Activity\n */\nexport const UnmountWhenHidden: React.FC<{ readonly children: React.ReactNode }> = ({\n children,\n}) => {\n // Next.js shows the hidden copy again when you navigate to a view you visited recently. That copy\n // is empty, so it would show a blank page until the view rendered again. `bfcacheId` changes on\n // those navigations, so the new key mounts the view as part of the navigation instead.\n // https://nextjs.org/docs/app/api-reference/functions/use-router#bfcacheid\n const { bfcacheId } = useRouter()\n\n return <RenderNothingWhileHidden key={bfcacheId}>{children}</RenderNothingWhileHidden>\n}\n\nconst RenderNothingWhileHidden: React.FC<{ readonly children: React.ReactNode }> = ({\n children,\n}) => {\n const [isVisible, setIsVisible] = useState(true)\n\n useLayoutEffect(() => {\n setIsVisible(true)\n\n return () => setIsVisible(false)\n }, [])\n\n return isVisible ? children : null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,SAAS,QAAQ;AAC1B,OAAOC,KAAA,IAASC,eAAe,EAAEC,QAAQ,QAAQ;AAEjD;;;;;;;;;;;;;AAaA,OAAO,MAAMC,iBAAA,GAAsEC,EAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EAAC;IAAAQ;EAAA,IAAAF,EAEnF;EAKC;IAAAG;EAAA,IAAsBR,SAAA;EAAA,IAAAS,EAAA;EAAA,IAAAH,CAAA,QAAAE,SAAA,IAAAF,CAAA,QAAAC,QAAA;IAEfE,EAAA,GAAAC,IAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","useRouter","React","useLayoutEffect","useState","UnmountWhenHidden","t0","$","children","bfcacheId","t1","_jsx","RenderNothingWhileHidden","isVisible","setIsVisible","t2","Symbol","for"],"sources":["../../../src/adapters/UnmountWhenHidden/index.tsx"],"sourcesContent":["'use client'\nimport { useRouter } from 'next/navigation.js'\nimport React, { useLayoutEffect, useState } from 'react'\n\n/**\n * With `cacheComponents`, Next.js does not unmount pages you navigate away from. It keeps the last\n * few inside a hidden React `<Activity>` boundary so going back can restore them. In the admin\n * panel, that leaves hidden copies of previous views in the DOM (duplicate element IDs, old client\n * state) and breaks selectors that expect a single match.\n *\n * React runs effect cleanups when an `<Activity>` boundary is hidden. This component uses that to\n * render nothing while hidden, so the view is mounted fresh when it becomes visible again, like it\n * is without `cacheComponents`. Only rendered when `cacheComponents` is enabled.\n *\n * @see https://github.com/vercel/next.js/issues/86577\n * @see https://react.dev/reference/react/Activity\n */\nexport const UnmountWhenHidden: React.FC<{ readonly children: React.ReactNode }> = ({\n children,\n}) => {\n // Next.js shows the hidden copy again when you navigate to a view you visited recently. That copy\n // is empty, so it would show a blank page until the view rendered again. `bfcacheId` changes on\n // those navigations, so the new key mounts the view as part of the navigation instead.\n // https://nextjs.org/docs/app/api-reference/functions/use-router#bfcacheid\n const { bfcacheId } = useRouter()\n\n return <RenderNothingWhileHidden key={bfcacheId}>{children}</RenderNothingWhileHidden>\n}\n\nconst RenderNothingWhileHidden: React.FC<{ readonly children: React.ReactNode }> = ({\n children,\n}) => {\n const [isVisible, setIsVisible] = useState(true)\n\n useLayoutEffect(() => {\n setIsVisible(true)\n\n return () => setIsVisible(false)\n }, [])\n\n return isVisible ? children : null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,SAAS,QAAQ;AAC1B,OAAOC,KAAA,IAASC,eAAe,EAAEC,QAAQ,QAAQ;AAEjD;;;;;;;;;;;;;AAaA,OAAO,MAAMC,iBAAA,GAAsEC,EAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EAAC;IAAAQ;EAAA,IAAAF,EAEnF;EAKC;IAAAG;EAAA,IAAsBR,SAAA;EAAA,IAAAS,EAAA;EAAA,IAAAH,CAAA,QAAAE,SAAA,IAAAF,CAAA,QAAAC,QAAA;IAEfE,EAAA,GAAAC,IAAA,CAACC,wBAAA;MAAAJ;OAA8BC,SAAA;IAAAF,CAAA,MAAAE,SAAA;IAAAF,CAAA,MAAAC,QAAA;IAAAD,CAAA,MAAAG,EAAA;EAAA;IAAAA,EAAA,GAAAH,CAAA;EAAA;EAAA,OAA/BG,EAA+B;AAAA,CACxC;AAEA,MAAME,wBAAA,GAA6EN,EAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EAAC;IAAAQ;EAAA,IAAAF,EAEnF;EACC,OAAAO,SAAA,EAAAC,YAAA,IAAkCV,QAAA,CAAS;EAAA,IAAAM,EAAA;EAAA,IAAAK,EAAA;EAAA,IAAAR,CAAA,QAAAS,MAAA,CAAAC,GAAA;IAE3BP,EAAA,GAAAA,CAAA;MACdI,YAAA,CAAa;MAAA,OAEN,MAAMA,YAAA,CAAa;IAAA,CAC5B;IAAGC,EAAA,KAAE;IAAAR,CAAA,MAAAG,EAAA;IAAAH,CAAA,MAAAQ,EAAA;EAAA;IAAAL,EAAA,GAAAH,CAAA;IAAAQ,EAAA,GAAAR,CAAA;EAAA;EAJLJ,eAAA,CAAgBO,EAIhB,EAAGK,EAAE;EAAA,OAEEF,SAAA,GAAAL,QAAuB,GAAvB,IAAuB;AAAA,CAChC","ignoreList":[]}
|
package/dist/adapters/router.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
import { RouterAdapterContext } from '@payloadcms/ui';
|
|
5
6
|
import NextLinkImport from 'next/link.js';
|
|
@@ -25,30 +26,66 @@ const NextLinkAdapter = ({
|
|
|
25
26
|
children: children
|
|
26
27
|
});
|
|
27
28
|
};
|
|
28
|
-
export const NextRouterAdapter =
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
export const NextRouterAdapter = t0 => {
|
|
30
|
+
const $ = _c(13);
|
|
31
|
+
const {
|
|
32
|
+
children
|
|
33
|
+
} = t0;
|
|
31
34
|
const nextRouter = useNextRouter();
|
|
32
35
|
const pathname = useNextPathname();
|
|
33
36
|
const searchParams = useNextSearchParams();
|
|
34
37
|
const params = useNextParams();
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
38
|
+
let t1;
|
|
39
|
+
if ($[0] !== nextRouter.back || $[1] !== nextRouter.push || $[2] !== nextRouter.refresh || $[3] !== nextRouter.replace) {
|
|
40
|
+
t1 = {
|
|
41
|
+
back: nextRouter.back,
|
|
42
|
+
push: nextRouter.push,
|
|
43
|
+
refresh: nextRouter.refresh,
|
|
44
|
+
replace: nextRouter.replace,
|
|
45
|
+
replaceState: _temp
|
|
46
|
+
};
|
|
47
|
+
$[0] = nextRouter.back;
|
|
48
|
+
$[1] = nextRouter.push;
|
|
49
|
+
$[2] = nextRouter.refresh;
|
|
50
|
+
$[3] = nextRouter.replace;
|
|
51
|
+
$[4] = t1;
|
|
52
|
+
} else {
|
|
53
|
+
t1 = $[4];
|
|
54
|
+
}
|
|
55
|
+
const router = t1;
|
|
56
|
+
let t2;
|
|
57
|
+
if ($[5] !== params || $[6] !== pathname || $[7] !== router || $[8] !== searchParams) {
|
|
58
|
+
t2 = {
|
|
59
|
+
Link: NextLinkAdapter,
|
|
60
|
+
params,
|
|
61
|
+
pathname,
|
|
62
|
+
router,
|
|
63
|
+
searchParams
|
|
64
|
+
};
|
|
65
|
+
$[5] = params;
|
|
66
|
+
$[6] = pathname;
|
|
67
|
+
$[7] = router;
|
|
68
|
+
$[8] = searchParams;
|
|
69
|
+
$[9] = t2;
|
|
70
|
+
} else {
|
|
71
|
+
t2 = $[9];
|
|
72
|
+
}
|
|
73
|
+
const value = t2;
|
|
74
|
+
let t3;
|
|
75
|
+
if ($[10] !== children || $[11] !== value) {
|
|
76
|
+
t3 = _jsx(RouterAdapterContext, {
|
|
77
|
+
value,
|
|
78
|
+
children
|
|
79
|
+
});
|
|
80
|
+
$[10] = children;
|
|
81
|
+
$[11] = value;
|
|
82
|
+
$[12] = t3;
|
|
83
|
+
} else {
|
|
84
|
+
t3 = $[12];
|
|
85
|
+
}
|
|
86
|
+
return t3;
|
|
53
87
|
};
|
|
88
|
+
function _temp(url) {
|
|
89
|
+
return window.history.replaceState(null, "", url);
|
|
90
|
+
}
|
|
54
91
|
//# sourceMappingURL=router.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.js","names":["RouterAdapterContext","NextLinkImport","useParams","useNextParams","usePathname","useNextPathname","useRouter","useNextRouter","useSearchParams","useNextSearchParams","React","NextLink","default","NextLinkAdapter","children","href","prefetch","ref","replace","scroll","rest","_jsx","NextRouterAdapter","nextRouter","pathname","searchParams","params","
|
|
1
|
+
{"version":3,"file":"router.js","names":["c","_c","RouterAdapterContext","NextLinkImport","useParams","useNextParams","usePathname","useNextPathname","useRouter","useNextRouter","useSearchParams","useNextSearchParams","React","NextLink","default","NextLinkAdapter","children","href","prefetch","ref","replace","scroll","rest","_jsx","NextRouterAdapter","t0","$","nextRouter","pathname","searchParams","params","t1","back","push","refresh","replaceState","_temp","router","t2","Link","value","t3","url","window","history"],"sources":["../../src/adapters/router.tsx"],"sourcesContent":["'use client'\nimport type { RouterAdapterContextValue } from '@payloadcms/ui'\nimport type { LinkAdapterProps } from 'payload'\n\nimport { RouterAdapterContext } from '@payloadcms/ui'\nimport NextLinkImport from 'next/link.js'\nimport {\n useParams as useNextParams,\n usePathname as useNextPathname,\n useRouter as useNextRouter,\n useSearchParams as useNextSearchParams,\n} from 'next/navigation.js'\nimport React from 'react'\n\ntype LinkComponent = React.FC<\n {\n children?: React.ReactNode\n href: string\n prefetch?: boolean\n ref?: React.Ref<HTMLAnchorElement>\n replace?: boolean\n scroll?: boolean\n } & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>\n>\n\nconst NextLink: LinkComponent =\n 'default' in NextLinkImport ? NextLinkImport.default : NextLinkImport\n\nconst NextLinkAdapter: React.FC<LinkAdapterProps> = ({\n children,\n href,\n prefetch,\n ref,\n replace,\n scroll,\n ...rest\n}) => {\n return (\n <NextLink href={href} prefetch={prefetch} ref={ref} replace={replace} scroll={scroll} {...rest}>\n {children}\n </NextLink>\n )\n}\n\nexport const NextRouterAdapter: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const nextRouter = useNextRouter()\n const pathname = useNextPathname()\n const searchParams = useNextSearchParams()\n const params = useNextParams()\n\n const router = React.useMemo<RouterAdapterContextValue['router']>(\n () => ({\n back: nextRouter.back,\n push: nextRouter.push,\n refresh: nextRouter.refresh,\n replace: nextRouter.replace,\n replaceState: (url) => window.history.replaceState(null, '', url),\n }),\n [nextRouter],\n )\n\n const value = React.useMemo<RouterAdapterContextValue>(\n () => ({\n Link: NextLinkAdapter,\n params,\n pathname,\n router,\n searchParams,\n }),\n [params, pathname, router, searchParams],\n )\n\n return <RouterAdapterContext value={value}>{children}</RouterAdapterContext>\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAIA,SAASC,oBAAoB,QAAQ;AACrC,OAAOC,cAAA,MAAoB;AAC3B,SACEC,SAAA,IAAaC,aAAa,EAC1BC,WAAA,IAAeC,eAAe,EAC9BC,SAAA,IAAaC,aAAa,EAC1BC,eAAA,IAAmBC,mBAAmB,QACjC;AACP,OAAOC,KAAA,MAAW;AAalB,MAAMC,QAAA,GACJ,aAAaV,cAAA,GAAiBA,cAAA,CAAeW,OAAO,GAAGX,cAAA;AAEzD,MAAMY,eAAA,GAA8CA,CAAC;EACnDC,QAAQ;EACRC,IAAI;EACJC,QAAQ;EACRC,GAAG;EACHC,OAAO;EACPC,MAAM;EACN,GAAGC;AAAA,CACJ;EACC,oBACEC,IAAA,CAACV,QAAA;IAASI,IAAA,EAAMA,IAAA;IAAMC,QAAA,EAAUA,QAAA;IAAUC,GAAA,EAAKA,GAAA;IAAKC,OAAA,EAASA,OAAA;IAASC,MAAA,EAAQA,MAAA;IAAS,GAAGC,IAAI;cAC3FN;;AAGP;AAEA,OAAO,MAAMQ,iBAAA,GAA6DC,EAAA;EAAA,MAAAC,CAAA,GAAAzB,EAAA;EAAC;IAAAe;EAAA,IAAAS,EAAY;EACrF,MAAAE,UAAA,GAAmBlB,aAAA;EACnB,MAAAmB,QAAA,GAAi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,EAAA,GAAAlB,IAAA,CAACrB,oBAAA;MAAAsC,KAAA;MAAAxB;;;;;;;;SAADyB,E;CACT;AA7B0E,SAAAL,MAAAM,GAAA;EAAA,OAY7CC,MAAA,CAAAC,OAAc,CAAAT,YAAa,CAAC,MAAM,IAAIO,GAAA;AAAA","ignoreList":[]}
|
package/dist/cjs/withPayload.cjs
CHANGED
|
@@ -34,6 +34,42 @@ __export(withPayload_exports, {
|
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(withPayload_exports);
|
|
36
36
|
var import_node_url = require("node:url");
|
|
37
|
+
|
|
38
|
+
// ../payload/src/exports/build-config.js
|
|
39
|
+
var devServerExternalPackages = [
|
|
40
|
+
"payload",
|
|
41
|
+
"@payloadcms/db-mongodb",
|
|
42
|
+
"@payloadcms/db-postgres",
|
|
43
|
+
"@payloadcms/db-sqlite",
|
|
44
|
+
"@payloadcms/db-vercel-postgres",
|
|
45
|
+
"@payloadcms/db-d1-sqlite",
|
|
46
|
+
"@payloadcms/drizzle",
|
|
47
|
+
"@payloadcms/email-nodemailer",
|
|
48
|
+
"@payloadcms/email-resend",
|
|
49
|
+
"@payloadcms/graphql",
|
|
50
|
+
"@payloadcms/kv-redis",
|
|
51
|
+
"@payloadcms/payload-cloud",
|
|
52
|
+
// Its `/client` entry has no exports, so the import map never loads anything from it.
|
|
53
|
+
"@payloadcms/plugin-mcp",
|
|
54
|
+
"@payloadcms/plugin-nested-docs",
|
|
55
|
+
"@payloadcms/plugin-redirects",
|
|
56
|
+
"@payloadcms/transformer-sharp",
|
|
57
|
+
"@payloadcms/translations"
|
|
58
|
+
];
|
|
59
|
+
var serverExternalPackages = [
|
|
60
|
+
// GraphQL requires a single runtime instance across bundled and external packages.
|
|
61
|
+
"graphql",
|
|
62
|
+
"drizzle-kit",
|
|
63
|
+
"drizzle-kit/api",
|
|
64
|
+
"sharp",
|
|
65
|
+
"libsql",
|
|
66
|
+
"require-in-the-middle",
|
|
67
|
+
"json-schema-to-typescript",
|
|
68
|
+
// Bundling pino's thread-stream dependency causes Turbopack build errors.
|
|
69
|
+
"pino"
|
|
70
|
+
];
|
|
71
|
+
|
|
72
|
+
// dist/withPayload/withPayload.js
|
|
37
73
|
var import_meta = {};
|
|
38
74
|
var poweredByHeader = {
|
|
39
75
|
key: "X-Powered-By",
|
|
@@ -132,66 +168,14 @@ var withPayload = (nextConfig = {}, options = {}) => {
|
|
|
132
168
|
source: "/:path*"
|
|
133
169
|
}];
|
|
134
170
|
},
|
|
135
|
-
serverExternalPackages: [
|
|
171
|
+
serverExternalPackages: [.../* @__PURE__ */ new Set([
|
|
136
172
|
...nextConfig.serverExternalPackages || [],
|
|
137
|
-
|
|
138
|
-
// during runtime ("Ensure that there is only one instance of \"graphql\" in the node_modules\ndirectory.")
|
|
139
|
-
"graphql",
|
|
140
|
-
"drizzle-kit",
|
|
141
|
-
"drizzle-kit/api",
|
|
142
|
-
"sharp",
|
|
143
|
-
"libsql",
|
|
144
|
-
"require-in-the-middle",
|
|
145
|
-
"json-schema-to-typescript",
|
|
146
|
-
// Prevents turbopack build errors by the thread-stream package which is installed by pino
|
|
147
|
-
"pino",
|
|
173
|
+
...serverExternalPackages,
|
|
148
174
|
// file-type v22 uses `import(specifier)` with a non-literal specifier, which Turbopack rejects
|
|
149
175
|
// with "Cannot find module as expression is too dynamic"
|
|
150
176
|
"file-type",
|
|
151
|
-
...process.env.NODE_ENV === "development" && options.devBundleServerPackages !== true ?
|
|
152
|
-
|
|
153
|
-
* Unless explicitly disabled by the user, by passing `devBundleServerPackages: true` to withPayload, we
|
|
154
|
-
* do not bundle server-only packages during dev. Node.js loads them directly instead, so there are fewer
|
|
155
|
-
* files to compile, which means faster compilation speeds.
|
|
156
|
-
*
|
|
157
|
-
* A package can only be listed here if the import map never loads a client component from it. Node.js
|
|
158
|
-
* loads external packages as they are, so a `'use client'` file inside one would not become a client
|
|
159
|
-
* component. That is why packages with client components are not listed (see the TODO below).
|
|
160
|
-
*
|
|
161
|
-
* We should only do this during development, not build, because externalizing these packages can hurt
|
|
162
|
-
* the bundle size. Not only does it disable tree-shaking, it also risks installing duplicate copies of the
|
|
163
|
-
* same package.
|
|
164
|
-
*
|
|
165
|
-
* Example:
|
|
166
|
-
* - @payloadcms/richtext-lexical (in bundle) -> installs qs-esm (bundled because of importer)
|
|
167
|
-
* - payload (not in bundle, external) -> installs qs-esm (external because of importer)
|
|
168
|
-
* Result: we have two copies of qs-esm installed - one in the bundle, and one in node_modules.
|
|
169
|
-
*
|
|
170
|
-
* During development, these bundle size differences do not matter much, and development speed is more
|
|
171
|
-
* important.
|
|
172
|
-
*/
|
|
173
|
-
[
|
|
174
|
-
"payload",
|
|
175
|
-
"@payloadcms/db-mongodb",
|
|
176
|
-
"@payloadcms/db-postgres",
|
|
177
|
-
"@payloadcms/db-sqlite",
|
|
178
|
-
"@payloadcms/db-vercel-postgres",
|
|
179
|
-
"@payloadcms/db-d1-sqlite",
|
|
180
|
-
"@payloadcms/drizzle",
|
|
181
|
-
"@payloadcms/email-nodemailer",
|
|
182
|
-
"@payloadcms/email-resend",
|
|
183
|
-
"@payloadcms/graphql",
|
|
184
|
-
"@payloadcms/kv-redis",
|
|
185
|
-
"@payloadcms/payload-cloud",
|
|
186
|
-
// Its `/client` entry has no exports, so the import map never loads anything from it
|
|
187
|
-
"@payloadcms/plugin-mcp",
|
|
188
|
-
"@payloadcms/plugin-nested-docs",
|
|
189
|
-
"@payloadcms/plugin-redirects",
|
|
190
|
-
"@payloadcms/transformer-sharp",
|
|
191
|
-
"@payloadcms/translations"
|
|
192
|
-
]
|
|
193
|
-
) : []
|
|
194
|
-
],
|
|
177
|
+
...process.env.NODE_ENV === "development" && options.devBundleServerPackages !== true ? devServerExternalPackages : []
|
|
178
|
+
])],
|
|
195
179
|
webpack: (webpackConfig, webpackOptions) => {
|
|
196
180
|
const incomingWebpackConfig = typeof nextConfig.webpack === "function" ? nextConfig.webpack(webpackConfig, webpackOptions) : webpackConfig;
|
|
197
181
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/withPayload/withPayload.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * These files must remain as plain JavaScript (.js) rather than TypeScript (.ts) because they are\n * imported directly in next.config.mjs files. Since next.config files run before the build process,\n * TypeScript compilation is not available. This ensures compatibility with all templates and\n * user projects regardless of their TypeScript setup.\n */\n\nimport { fileURLToPath } from 'node:url'\n\nconst poweredByHeader = {\n key: 'X-Powered-By',\n value: 'Next.js, Payload',\n}\n\n/**\n * @param {import('next').NextConfig} nextConfig\n * @param {Object} [options] - Optional configuration options\n * @param {boolean} [options.devBundleServerPackages] - Whether to bundle server packages in development mode. @default false\n * */\nexport const withPayload = (nextConfig = {}, options = {}) => {\n const env = { ...nextConfig.env }\n // Adds `export const instant = false` to the admin layout and page. See `instantLoader.js` for\n // why this cannot live in the generated admin files.\n const instantLoader = nextConfig.cacheComponents\n ? typeof import.meta?.resolve === 'function'\n ? fileURLToPath(new URL('./instantLoader.js', import.meta.url))\n : require.resolve('@payloadcms/next/withPayload/instantLoader')\n : undefined\n const instantLoaderRule = '**/{layout,page}.{js,jsx,ts,tsx,mjs,mts,cjs,cts}'\n\n if (nextConfig.experimental?.staleTimes?.dynamic) {\n console.warn(\n 'Payload: detected a non-zero value for the `staleTimes.dynamic` option in your Next.js config. This will slow down page transitions and may cause stale data to load within the Admin panel. To clear this warning, remove the `staleTimes.dynamic` option from your Next.js config or set it to 0. In the future, Next.js may support scoping this option to specific routes.',\n )\n env.NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH = 'true'\n }\n\n if (nextConfig.cacheComponents) {\n env.PAYLOAD_CACHE_COMPONENTS_ENABLED = 'true'\n }\n\n const consoleWarn = console.warn\n\n const sassWarningTexts = [\n // This warning is a lie - without silencing import deprecation warnings, sass will spam the console with deprecation warnings\n 'Future import deprecation is not yet active, so silencing it is unnecessary',\n // Sometimes happens despite silenceDeprecations\n 'The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0',\n ]\n console.warn = (...args) => {\n if (\n (typeof args[1] === 'string' && sassWarningTexts.some((text) => args[1].includes(text))) ||\n (typeof args[0] === 'string' && sassWarningTexts.some((text) => args[0].includes(text)))\n ) {\n return\n }\n\n consoleWarn(...args)\n }\n\n /** @type {import('next').NextConfig} */\n const baseConfig = {\n ...nextConfig,\n devIndicators: nextConfig.devIndicators !== undefined ? nextConfig.devIndicators : false,\n env,\n experimental: {\n ...(nextConfig.experimental || {}),\n },\n sassOptions: {\n ...(nextConfig.sassOptions || {}),\n /**\n * This prevents scss warning spam during pnpm dev that looks like this:\n * ⚠ ./path/to/some/index.scss\n * Issue while running loader\n * SassWarning: Deprecation Warning: Sass @import rules are deprecated and\n * will be removed in Dart Sass 3.0.0.\n *\n * More info and automated migrator: https://sass-lang.com/d/import\n *\n * This can be triggered by any `.scss` file in a consumer's project that\n * still uses `@import`.\n */\n silenceDeprecations: [...(nextConfig.sassOptions?.silenceDeprecations || []), 'import'],\n },\n outputFileTracingExcludes: {\n ...(nextConfig.outputFileTracingExcludes || {}),\n '**/*': [\n ...(nextConfig.outputFileTracingExcludes?.['**/*'] || []),\n 'drizzle-kit',\n 'drizzle-kit/api',\n ],\n },\n turbopack: {\n ...(nextConfig.turbopack || {}),\n ...(instantLoader\n ? {\n rules: {\n ...nextConfig.turbopack?.rules,\n [instantLoaderRule]: [\n ...[].concat(nextConfig.turbopack?.rules?.[instantLoaderRule] ?? []),\n {\n // Only send files that import the admin root components to the loader, so\n // Turbopack does not run a JavaScript loader for every other layout and page.\n condition: {\n all: [\n { not: 'foreign' },\n { content: /['\"]@payloadcms\\/next\\/(?:layouts|views)['\"]/ },\n ],\n },\n loaders: [instantLoader],\n },\n ],\n },\n }\n : {}),\n },\n // We disable the poweredByHeader here because we add it manually in the headers function below\n ...(nextConfig.poweredByHeader !== false ? { poweredByHeader: false } : {}),\n headers: async () => {\n const headersFromConfig = 'headers' in nextConfig ? await nextConfig.headers() : []\n\n return [\n ...(headersFromConfig || []),\n {\n headers: [\n {\n key: 'Accept-CH',\n value: 'Sec-CH-Prefers-Color-Scheme',\n },\n {\n key: 'Vary',\n value: 'Sec-CH-Prefers-Color-Scheme',\n },\n {\n key: 'Critical-CH',\n value: 'Sec-CH-Prefers-Color-Scheme',\n },\n ...(nextConfig.poweredByHeader !== false ? [poweredByHeader] : []),\n ],\n source: '/:path*',\n },\n ]\n },\n serverExternalPackages: [\n ...(nextConfig.serverExternalPackages || []),\n // WHY: without externalizing graphql, a graphql version error will be thrown\n // during runtime (\"Ensure that there is only one instance of \\\"graphql\\\" in the node_modules\\ndirectory.\")\n 'graphql',\n 'drizzle-kit',\n 'drizzle-kit/api',\n 'sharp',\n 'libsql',\n 'require-in-the-middle',\n 'json-schema-to-typescript',\n // Prevents turbopack build errors by the thread-stream package which is installed by pino\n 'pino',\n // file-type v22 uses `import(specifier)` with a non-literal specifier, which Turbopack rejects\n // with \"Cannot find module as expression is too dynamic\"\n 'file-type',\n ...(process.env.NODE_ENV === 'development' && options.devBundleServerPackages !== true\n ? /**\n * Unless explicitly disabled by the user, by passing `devBundleServerPackages: true` to withPayload, we\n * do not bundle server-only packages during dev. Node.js loads them directly instead, so there are fewer\n * files to compile, which means faster compilation speeds.\n *\n * A package can only be listed here if the import map never loads a client component from it. Node.js\n * loads external packages as they are, so a `'use client'` file inside one would not become a client\n * component. That is why packages with client components are not listed (see the TODO below).\n *\n * We should only do this during development, not build, because externalizing these packages can hurt\n * the bundle size. Not only does it disable tree-shaking, it also risks installing duplicate copies of the\n * same package.\n *\n * Example:\n * - @payloadcms/richtext-lexical (in bundle) -> installs qs-esm (bundled because of importer)\n * - payload (not in bundle, external) -> installs qs-esm (external because of importer)\n * Result: we have two copies of qs-esm installed - one in the bundle, and one in node_modules.\n *\n * During development, these bundle size differences do not matter much, and development speed is more\n * important.\n */\n [\n 'payload',\n '@payloadcms/db-mongodb',\n '@payloadcms/db-postgres',\n '@payloadcms/db-sqlite',\n '@payloadcms/db-vercel-postgres',\n '@payloadcms/db-d1-sqlite',\n '@payloadcms/drizzle',\n '@payloadcms/email-nodemailer',\n '@payloadcms/email-resend',\n '@payloadcms/graphql',\n '@payloadcms/kv-redis',\n '@payloadcms/payload-cloud',\n // Its `/client` entry has no exports, so the import map never loads anything from it\n '@payloadcms/plugin-mcp',\n '@payloadcms/plugin-nested-docs',\n '@payloadcms/plugin-redirects',\n '@payloadcms/transformer-sharp',\n '@payloadcms/translations',\n // TODO: Add the following packages, excluding their /client subpath exports, once Next.js supports it\n // see: https://github.com/vercel/next.js/discussions/76991\n //'@payloadcms/plugin-cloud-storage',\n //'@payloadcms/plugin-sentry',\n //'@payloadcms/plugin-stripe',\n // @payloadcms/richtext-lexical\n //'@payloadcms/storage-azure',\n //'@payloadcms/storage-gcs',\n //'@payloadcms/storage-s3',\n //'@payloadcms/storage-vercel-blob',\n ]\n : []),\n ],\n webpack: (webpackConfig, webpackOptions) => {\n const incomingWebpackConfig =\n typeof nextConfig.webpack === 'function'\n ? nextConfig.webpack(webpackConfig, webpackOptions)\n : webpackConfig\n\n return {\n ...incomingWebpackConfig,\n ...(instantLoader\n ? {\n module: {\n ...incomingWebpackConfig.module,\n rules: [\n ...(incomingWebpackConfig.module?.rules || []),\n {\n enforce: 'pre',\n exclude: /node_modules/,\n test: /[/\\\\](layout|page)\\.(?:[cm]?[jt]s|[jt]sx)$/,\n use: [instantLoader],\n },\n ],\n },\n }\n : {}),\n externals: [\n ...(incomingWebpackConfig?.externals || []),\n /**\n * We need to force Webpack to emit require() calls for these packages, even though they are not\n * resolvable from the project root. You would expect this to error during runtime, but Next.js seems to be able to require these just fine.\n *\n * This is the only way to get Webpack Build to work, without the bundle size caveats of externalizing the\n * entry point packages, as explained in the serverExternalPackages section above.\n */\n 'drizzle-kit',\n 'drizzle-kit/api',\n 'sharp',\n 'libsql',\n 'require-in-the-middle',\n 'json-schema-to-typescript',\n ],\n plugins: [\n ...(incomingWebpackConfig?.plugins || []),\n // Fix cloudflare:sockets error: https://github.com/vercel/next.js/discussions/50177\n new webpackOptions.webpack.IgnorePlugin({\n resourceRegExp: /^pg-native$|^cloudflare:sockets$/,\n }),\n ],\n resolve: {\n ...(incomingWebpackConfig?.resolve || {}),\n alias: {\n ...(incomingWebpackConfig?.resolve?.alias || {}),\n },\n fallback: {\n ...(incomingWebpackConfig?.resolve?.fallback || {}),\n /*\n * This fixes the following warning when running next build with webpack (tested on Next.js 16.0.3 with Payload 3.64.0):\n *\n * ⚠ Compiled with warnings in 8.7s\n *\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js\n * Module not found: Can't resolve 'aws4' in '/Users/alessio/Documents/temp/next16p/node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib'\n *\n * Import trace for requested module:\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/index.js\n * ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/lib/index.js\n * ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/index.js\n * ./node_modules/.pnpm/@payloadcms+db-mongodb@3.64.0_payload@3.64.0_graphql@16.12.0_typescript@5.7.3_/node_modules/@payloadcms/db-mongodb/dist/index.js\n * ./src/payload.config.ts\n * ./src/app/my-route/route.ts\n *\n **/\n aws4: false,\n },\n },\n }\n },\n }\n\n if (nextConfig.basePath) {\n process.env.NEXT_BASE_PATH = nextConfig.basePath\n baseConfig.env.NEXT_BASE_PATH = nextConfig.basePath\n }\n\n const trailingSlash = nextConfig.trailingSlash === true ? 'true' : 'false'\n process.env.NEXT_TRAILING_SLASH = trailingSlash\n baseConfig.env.NEXT_TRAILING_SLASH = trailingSlash\n\n return baseConfig\n}\n\nexport default withPayload\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAOA,sBAA8B;
|
|
6
|
-
"names": ["poweredByHeader", "key", "value", "withPayload", "nextConfig", "options", "env", "instantLoader", "cacheComponents", "import", "resolve", "fileURLToPath", "URL", "url", "require", "undefined", "instantLoaderRule", "experimental", "staleTimes", "dynamic", "console", "warn", "NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH", "PAYLOAD_CACHE_COMPONENTS_ENABLED", "consoleWarn", "sassWarningTexts", "args", "some", "text", "includes", "baseConfig", "devIndicators", "sassOptions", "silenceDeprecations", "outputFileTracingExcludes", "turbopack", "rules", "concat", "condition", "all", "not", "content", "loaders", "headers", "headersFromConfig", "source", "serverExternalPackages", "process", "NODE_ENV", "devBundleServerPackages", "webpack", "webpackConfig", "webpackOptions", "incomingWebpackConfig", "module", "enforce", "exclude", "test", "use", "externals", "plugins", "IgnorePlugin", "resourceRegExp", "alias", "fallback", "aws4", "basePath", "NEXT_BASE_PATH", "trailingSlash", "NEXT_TRAILING_SLASH"]
|
|
3
|
+
"sources": ["../../src/withPayload/withPayload.js", "../../../payload/src/exports/build-config.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * These files must remain as plain JavaScript (.js) rather than TypeScript (.ts) because they are\n * imported directly in next.config.mjs files. Since next.config files run before the build process,\n * TypeScript compilation is not available. This ensures compatibility with all templates and\n * user projects regardless of their TypeScript setup.\n */\n\nimport { fileURLToPath } from 'node:url'\nimport {\n devServerExternalPackages as devServerExternalPayloadPackages,\n serverExternalPackages as serverExternalPayloadPackages,\n} from 'payload/build-config'\n\nconst poweredByHeader = {\n key: 'X-Powered-By',\n value: 'Next.js, Payload',\n}\n\n/**\n * @param {import('next').NextConfig} nextConfig\n * @param {Object} [options] - Optional configuration options\n * @param {boolean} [options.devBundleServerPackages] - Whether to bundle server packages in development mode. @default false\n * */\nexport const withPayload = (nextConfig = {}, options = {}) => {\n const env = { ...nextConfig.env }\n // Adds `export const instant = false` to the admin layout and page. See `instantLoader.js` for\n // why this cannot live in the generated admin files.\n const instantLoader = nextConfig.cacheComponents\n ? typeof import.meta?.resolve === 'function'\n ? fileURLToPath(new URL('./instantLoader.js', import.meta.url))\n : require.resolve('@payloadcms/next/withPayload/instantLoader')\n : undefined\n const instantLoaderRule = '**/{layout,page}.{js,jsx,ts,tsx,mjs,mts,cjs,cts}'\n\n if (nextConfig.experimental?.staleTimes?.dynamic) {\n console.warn(\n 'Payload: detected a non-zero value for the `staleTimes.dynamic` option in your Next.js config. This will slow down page transitions and may cause stale data to load within the Admin panel. To clear this warning, remove the `staleTimes.dynamic` option from your Next.js config or set it to 0. In the future, Next.js may support scoping this option to specific routes.',\n )\n env.NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH = 'true'\n }\n\n if (nextConfig.cacheComponents) {\n env.PAYLOAD_CACHE_COMPONENTS_ENABLED = 'true'\n }\n\n const consoleWarn = console.warn\n\n const sassWarningTexts = [\n // This warning is a lie - without silencing import deprecation warnings, sass will spam the console with deprecation warnings\n 'Future import deprecation is not yet active, so silencing it is unnecessary',\n // Sometimes happens despite silenceDeprecations\n 'The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0',\n ]\n console.warn = (...args) => {\n if (\n (typeof args[1] === 'string' && sassWarningTexts.some((text) => args[1].includes(text))) ||\n (typeof args[0] === 'string' && sassWarningTexts.some((text) => args[0].includes(text)))\n ) {\n return\n }\n\n consoleWarn(...args)\n }\n\n /** @type {import('next').NextConfig} */\n const baseConfig = {\n ...nextConfig,\n devIndicators: nextConfig.devIndicators !== undefined ? nextConfig.devIndicators : false,\n env,\n experimental: {\n ...(nextConfig.experimental || {}),\n },\n sassOptions: {\n ...(nextConfig.sassOptions || {}),\n /**\n * This prevents scss warning spam during pnpm dev that looks like this:\n * ⚠ ./path/to/some/index.scss\n * Issue while running loader\n * SassWarning: Deprecation Warning: Sass @import rules are deprecated and\n * will be removed in Dart Sass 3.0.0.\n *\n * More info and automated migrator: https://sass-lang.com/d/import\n *\n * This can be triggered by any `.scss` file in a consumer's project that\n * still uses `@import`.\n */\n silenceDeprecations: [...(nextConfig.sassOptions?.silenceDeprecations || []), 'import'],\n },\n outputFileTracingExcludes: {\n ...(nextConfig.outputFileTracingExcludes || {}),\n '**/*': [\n ...(nextConfig.outputFileTracingExcludes?.['**/*'] || []),\n 'drizzle-kit',\n 'drizzle-kit/api',\n ],\n },\n turbopack: {\n ...(nextConfig.turbopack || {}),\n ...(instantLoader\n ? {\n rules: {\n ...nextConfig.turbopack?.rules,\n [instantLoaderRule]: [\n ...[].concat(nextConfig.turbopack?.rules?.[instantLoaderRule] ?? []),\n {\n // Only send files that import the admin root components to the loader, so\n // Turbopack does not run a JavaScript loader for every other layout and page.\n condition: {\n all: [\n { not: 'foreign' },\n { content: /['\"]@payloadcms\\/next\\/(?:layouts|views)['\"]/ },\n ],\n },\n loaders: [instantLoader],\n },\n ],\n },\n }\n : {}),\n },\n // We disable the poweredByHeader here because we add it manually in the headers function below\n ...(nextConfig.poweredByHeader !== false ? { poweredByHeader: false } : {}),\n headers: async () => {\n const headersFromConfig = 'headers' in nextConfig ? await nextConfig.headers() : []\n\n return [\n ...(headersFromConfig || []),\n {\n headers: [\n {\n key: 'Accept-CH',\n value: 'Sec-CH-Prefers-Color-Scheme',\n },\n {\n key: 'Vary',\n value: 'Sec-CH-Prefers-Color-Scheme',\n },\n {\n key: 'Critical-CH',\n value: 'Sec-CH-Prefers-Color-Scheme',\n },\n ...(nextConfig.poweredByHeader !== false ? [poweredByHeader] : []),\n ],\n source: '/:path*',\n },\n ]\n },\n serverExternalPackages: [\n ...new Set([\n ...(nextConfig.serverExternalPackages || []),\n ...serverExternalPayloadPackages,\n // file-type v22 uses `import(specifier)` with a non-literal specifier, which Turbopack rejects\n // with \"Cannot find module as expression is too dynamic\"\n 'file-type',\n ...(process.env.NODE_ENV === 'development' && options.devBundleServerPackages !== true\n ? devServerExternalPayloadPackages\n : []),\n ]),\n ],\n webpack: (webpackConfig, webpackOptions) => {\n const incomingWebpackConfig =\n typeof nextConfig.webpack === 'function'\n ? nextConfig.webpack(webpackConfig, webpackOptions)\n : webpackConfig\n\n return {\n ...incomingWebpackConfig,\n ...(instantLoader\n ? {\n module: {\n ...incomingWebpackConfig.module,\n rules: [\n ...(incomingWebpackConfig.module?.rules || []),\n {\n enforce: 'pre',\n exclude: /node_modules/,\n test: /[/\\\\](layout|page)\\.(?:[cm]?[jt]s|[jt]sx)$/,\n use: [instantLoader],\n },\n ],\n },\n }\n : {}),\n externals: [\n ...(incomingWebpackConfig?.externals || []),\n /**\n * We need to force Webpack to emit require() calls for these packages, even though they are not\n * resolvable from the project root. You would expect this to error during runtime, but Next.js seems to be able to require these just fine.\n *\n * This is the only way to get Webpack Build to work, without the bundle size caveats of externalizing the\n * entry point packages, as explained in the serverExternalPackages section above.\n */\n 'drizzle-kit',\n 'drizzle-kit/api',\n 'sharp',\n 'libsql',\n 'require-in-the-middle',\n 'json-schema-to-typescript',\n ],\n plugins: [\n ...(incomingWebpackConfig?.plugins || []),\n // Fix cloudflare:sockets error: https://github.com/vercel/next.js/discussions/50177\n new webpackOptions.webpack.IgnorePlugin({\n resourceRegExp: /^pg-native$|^cloudflare:sockets$/,\n }),\n ],\n resolve: {\n ...(incomingWebpackConfig?.resolve || {}),\n alias: {\n ...(incomingWebpackConfig?.resolve?.alias || {}),\n },\n fallback: {\n ...(incomingWebpackConfig?.resolve?.fallback || {}),\n /*\n * This fixes the following warning when running next build with webpack (tested on Next.js 16.0.3 with Payload 3.64.0):\n *\n * ⚠ Compiled with warnings in 8.7s\n *\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js\n * Module not found: Can't resolve 'aws4' in '/Users/alessio/Documents/temp/next16p/node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib'\n *\n * Import trace for requested module:\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/deps.js\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js\n * ./node_modules/.pnpm/mongodb@6.16.0/node_modules/mongodb/lib/index.js\n * ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/lib/index.js\n * ./node_modules/.pnpm/mongoose@8.15.1/node_modules/mongoose/index.js\n * ./node_modules/.pnpm/@payloadcms+db-mongodb@3.64.0_payload@3.64.0_graphql@16.12.0_typescript@5.7.3_/node_modules/@payloadcms/db-mongodb/dist/index.js\n * ./src/payload.config.ts\n * ./src/app/my-route/route.ts\n *\n **/\n aws4: false,\n },\n },\n }\n },\n }\n\n if (nextConfig.basePath) {\n process.env.NEXT_BASE_PATH = nextConfig.basePath\n baseConfig.env.NEXT_BASE_PATH = nextConfig.basePath\n }\n\n const trailingSlash = nextConfig.trailingSlash === true ? 'true' : 'false'\n process.env.NEXT_TRAILING_SLASH = trailingSlash\n baseConfig.env.NEXT_TRAILING_SLASH = trailingSlash\n\n return baseConfig\n}\n\nexport default withPayload\n", "/**\n * Server-only Payload packages that can skip development transforms.\n * Packages with client components loaded by the import map must remain bundled.\n * Production bundling preserves tree-shaking and avoids duplicate dependencies.\n */\nexport const devServerExternalPackages = [\n 'payload',\n '@payloadcms/db-mongodb',\n '@payloadcms/db-postgres',\n '@payloadcms/db-sqlite',\n '@payloadcms/db-vercel-postgres',\n '@payloadcms/db-d1-sqlite',\n '@payloadcms/drizzle',\n '@payloadcms/email-nodemailer',\n '@payloadcms/email-resend',\n '@payloadcms/graphql',\n '@payloadcms/kv-redis',\n '@payloadcms/payload-cloud',\n // Its `/client` entry has no exports, so the import map never loads anything from it.\n '@payloadcms/plugin-mcp',\n '@payloadcms/plugin-nested-docs',\n '@payloadcms/plugin-redirects',\n '@payloadcms/transformer-sharp',\n '@payloadcms/translations',\n]\n\n/** Third-party packages that both framework adapters externalize in development and production. */\nexport const serverExternalPackages = [\n // GraphQL requires a single runtime instance across bundled and external packages.\n 'graphql',\n 'drizzle-kit',\n 'drizzle-kit/api',\n 'sharp',\n 'libsql',\n 'require-in-the-middle',\n 'json-schema-to-typescript',\n // Bundling pino's thread-stream dependency causes Turbopack build errors.\n 'pino',\n]\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAOA,sBAA8B;;;ACFvB,IAAM,4BAA4B;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,IAAM,yBAAyB;AAAA;AAAA,EAEpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AACF;;;ADtCA;AAaA,IAAMA,kBAAkB;EACtBC,KAAK;EACLC,OAAO;AACT;AAOO,IAAMC,cAAcA,CAACC,aAAa,CAAC,GAAGC,UAAU,CAAC,MAAC;AACvD,QAAMC,MAAM;IAAE,GAAGF,WAAWE;EAAI;AAGhC,QAAMC,gBAAgBH,WAAWI,kBAC7B,OAAOC,aAAaC,YAAY,iBAC9BC,+BAAc,IAAIC,IAAI,sBAAsBH,YAAYI,GAAG,CAAA,IAC3DC,gBAAgB,4CAAA,IAClBC;AACJ,QAAMC,oBAAoB;AAE1B,MAAIZ,WAAWa,cAAcC,YAAYC,SAAS;AAChDC,YAAQC,KACN,gXAAA;AAEFf,QAAIgB,0CAA0C;EAChD;AAEA,MAAIlB,WAAWI,iBAAiB;AAC9BF,QAAIiB,mCAAmC;EACzC;AAEA,QAAMC,cAAcJ,QAAQC;AAE5B,QAAMI,mBAAmB;;IAEvB;;IAEA;EAAA;AAEFL,UAAQC,OAAO,IAAIK,SAAA;AACjB,QACE,OAAQA,KAAK,CAAA,MAAO,YAAYD,iBAAiBE,KAAMC,UAASF,KAAK,CAAA,EAAGG,SAASD,IAAA,CAAA,K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iE;AACxCvC,eAAWxB,IAAIgE,iBAAiBlE,WAAWiE;EAC7C;AAEA,QAAME,gBAAgBnE,WAAWmE,kBAAkB,OAAO,SAAS;AACnEtB,UAAQ3C,IAAIkE,sBAAsBD;AAClCzC,aAAWxB,IAAIkE,sBAAsBD;AAErC,SAAOzC;AACT;AAEA,IAAA,sBAAe3B;",
|
|
6
|
+
"names": ["poweredByHeader", "key", "value", "withPayload", "nextConfig", "options", "env", "instantLoader", "cacheComponents", "import", "resolve", "fileURLToPath", "URL", "url", "require", "undefined", "instantLoaderRule", "experimental", "staleTimes", "dynamic", "console", "warn", "NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH", "PAYLOAD_CACHE_COMPONENTS_ENABLED", "consoleWarn", "sassWarningTexts", "args", "some", "text", "includes", "baseConfig", "devIndicators", "sassOptions", "silenceDeprecations", "outputFileTracingExcludes", "turbopack", "rules", "concat", "condition", "all", "not", "content", "loaders", "headers", "headersFromConfig", "source", "serverExternalPackages", "Set", "serverExternalPayloadPackages", "process", "NODE_ENV", "devBundleServerPackages", "devServerExternalPayloadPackages", "webpack", "webpackConfig", "webpackOptions", "incomingWebpackConfig", "module", "enforce", "exclude", "test", "use", "externals", "plugins", "IgnorePlugin", "resourceRegExp", "alias", "fallback", "aws4", "basePath", "NEXT_BASE_PATH", "trailingSlash", "NEXT_TRAILING_SLASH"]
|
|
7
7
|
}
|