-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathnext.config.mjs
More file actions
113 lines (106 loc) · 2.26 KB
/
Copy pathnext.config.mjs
File metadata and controls
113 lines (106 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/** @type {import('next').NextConfig} */
import cacheConfig from "./cacheConfig.mjs";
const { protocol, hostname } = new URL(process.env.NEXTAUTH_URL || "http://localhost:3000");
import pwa from "next-pwa";
const isDev = process.env.NODE_ENV === "development";
// Completely disable Sass logger to silence deprecation warnings
const sassOptions = {
sassOptions: {
logger: {
debug: () => {},
warn: () => {},
error: () => {},
},
},
};
const nextConfig = {
...sassOptions,
reactStrictMode: isDev,
swcMinify: true,
experimental: {
// Enable Turbo mode with better caching
turbo: {},
// Better package optimization
optimizePackageImports: [
"antd",
"lucide-react",
"@ant-design/icons",
"react-icons",
"@tiptap/react",
"@tiptap/core",
],
// Optimize server components
serverComponentsExternalPackages: ["sharp", "canvas", "puppeteer", "ffmpeg", "sodium-native"],
},
transpilePackages: [
// antd & deps
"@ant-design",
"@rc-component",
"antd",
"rc-cascader",
"rc-checkbox",
"rc-collapse",
"rc-dialog",
"rc-drawer",
"rc-dropdown",
"rc-field-form",
"rc-image",
"rc-input",
"rc-input-number",
"rc-mentions",
"rc-menu",
"rc-motion",
"rc-notification",
"rc-pagination",
"rc-picker",
"rc-progress",
"rc-rate",
"rc-resize-observer",
"rc-segmented",
"rc-select",
"rc-slider",
"rc-steps",
"rc-switch",
"rc-table",
"rc-tabs",
"rc-textarea",
"rc-tooltip",
"rc-tree",
"rc-tree-select",
"rc-upload",
"rc-util",
],
images: {
remotePatterns: [
{
protocol: "https",
hostname: "**.b-cdn.net",
},
{
protocol: "https",
hostname: "**.torqbit.com",
},
{
protocol: protocol.slice(0, -1) || "http",
hostname: hostname || "localhost",
},
],
},
productionBrowserSourceMaps: isDev,
typescript: {
//for production
ignoreBuildErrors: true,
},
eslint: {
//for production
ignoreDuringBuilds: true,
},
};
const withPWA = pwa({
dest: "public",
register: true,
skipWaiting: true,
disable: isDev,
runtimeCaching: cacheConfig,
});
export default withPWA(nextConfig);