forked from mario-andreschak/FLUJO
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
94 lines (86 loc) · 2.37 KB
/
Copy pathnext.config.ts
File metadata and controls
94 lines (86 loc) · 2.37 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
import type { NextConfig } from "next";
import path from 'path';
const nextConfig: NextConfig = {
/* config options here */
typescript: {
// Ignore all TypeScript errors during build
ignoreBuildErrors: true,
},
eslint: {
// Ignore all ESLint errors during build
ignoreDuringBuilds: true,
},
transpilePackages: [
'@mui/material',
'@mui/icons-material',
'@mui/system',
'@mui/utils',
'@emotion/react',
'@emotion/styled'
],
// Increase the webpack chunk loading timeout and configure other performance settings
webpack: (config, { dev, isServer }) => {
// Only apply these settings in development mode
if (dev && !isServer) {
// Increase chunk loading timeout to 60 seconds (60000ms)
config.output = {
...config.output,
chunkLoadTimeout: 60000,
};
// Optimize for development performance
config.optimization = {
...config.optimization,
runtimeChunk: 'single',
splitChunks: {
chunks: 'all',
cacheGroups: {
vendors: {
test: /[\\/]node_modules[\\/](?!.*\.css$)/, // Exclude CSS files from vendors chunk
name: 'vendors',
priority: -10,
reuseExistingChunk: true,
},
styles: {
name: 'styles',
test: /\.css$/,
chunks: 'all',
enforce: true,
priority: 20,
},
},
},
};
// Configure watchOptions for better file watching
config.watchOptions = {
...config.watchOptions,
poll: 1000, // Check for changes every second
aggregateTimeout: 300, // Delay before rebuilding
};
}
// Exclude node binary files from being processed by webpack
config.externals = [...(config.externals || []),
{
sharp: 'commonjs sharp',
'node-gyp-build': 'commonjs node-gyp-build'
}
];
// Handle binary modules properly
config.module = {
...config.module,
rules: [
...(config.module?.rules || []),
{
test: /\.node$/,
use: 'node-loader',
},
],
};
// Enable WebAssembly
config.experiments = {
...config.experiments,
asyncWebAssembly: true,
};
return config;
},
};
export default nextConfig;