UNPKG

2.83 kBJavaScriptView Raw
1/**
2 * @param {import('next').NextConfig} nextConfig
3 *
4 * @returns {import('next').NextConfig}
5 * */ export const withPayload = (nextConfig = {})=>{
6 return {
7 ...nextConfig,
8 experimental: {
9 ...nextConfig?.experimental || {},
10 outputFileTracingExcludes: {
11 '**/*': [
12 ...nextConfig.experimental?.outputFileTracingExcludes?.['**/*'] || [],
13 'drizzle-kit',
14 'drizzle-kit/payload',
15 'libsql'
16 ]
17 },
18 serverComponentsExternalPackages: [
19 ...nextConfig?.experimental?.serverComponentsExternalPackages || [],
20 'drizzle-kit',
21 'drizzle-kit/payload',
22 'libsql',
23 'pino',
24 'pino-pretty',
25 'graphql'
26 ]
27 },
28 webpack: (webpackConfig, webpackOptions)=>{
29 const incomingWebpackConfig = typeof nextConfig.webpack === 'function' ? nextConfig.webpack(webpackConfig, webpackOptions) : webpackConfig;
30 return {
31 ...incomingWebpackConfig,
32 externals: [
33 ...incomingWebpackConfig?.externals || [],
34 'drizzle-kit',
35 'drizzle-kit/payload',
36 'sharp',
37 'libsql'
38 ],
39 ignoreWarnings: [
40 ...incomingWebpackConfig?.ignoreWarnings || [],
41 {
42 module: /node_modules\/mongodb\/lib\/utils\.js/
43 },
44 {
45 file: /node_modules\/mongodb\/lib\/utils\.js/
46 },
47 {
48 module: /node_modules\/mongodb\/lib\/bson\.js/
49 },
50 {
51 file: /node_modules\/mongodb\/lib\/bson\.js/
52 }
53 ],
54 resolve: {
55 ...incomingWebpackConfig?.resolve || {},
56 alias: {
57 ...incomingWebpackConfig?.resolve?.alias || {}
58 },
59 fallback: {
60 ...incomingWebpackConfig?.resolve?.fallback || {},
61 '@aws-sdk/credential-providers': false,
62 '@mongodb-js/zstd': false,
63 aws4: false,
64 kerberos: false,
65 'mongodb-client-encryption': false,
66 snappy: false,
67 'supports-color': false,
68 'yocto-queue': false
69 }
70 }
71 };
72 }
73 };
74};
75export default withPayload;
76
77//# sourceMappingURL=withPayload.js.map
\No newline at end of file