73 lines
1.5 KiB
JavaScript
73 lines
1.5 KiB
JavaScript
/**
|
|
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
|
|
* for Docker builds.
|
|
*/
|
|
import "./src/env.js";
|
|
|
|
/** @type {import("next").NextConfig} */
|
|
const config = {
|
|
images: {
|
|
remotePatterns: [
|
|
{
|
|
protocol: 'https',
|
|
hostname: '**',
|
|
},
|
|
{
|
|
protocol: 'http',
|
|
hostname: '**',
|
|
},
|
|
],
|
|
},
|
|
// Allow cross-origin requests from local network ranges
|
|
allowedDevOrigins: [
|
|
'localhost:3000',
|
|
'127.0.0.1:3000',
|
|
'[::1]:3000',
|
|
'10.*',
|
|
'172.16.*',
|
|
'172.17.*',
|
|
'172.18.*',
|
|
'172.19.*',
|
|
'172.20.*',
|
|
'172.21.*',
|
|
'172.22.*',
|
|
'172.23.*',
|
|
'172.24.*',
|
|
'172.25.*',
|
|
'172.26.*',
|
|
'172.27.*',
|
|
'172.28.*',
|
|
'172.29.*',
|
|
'172.30.*',
|
|
'172.31.*',
|
|
'192.168.*',
|
|
],
|
|
|
|
turbopack: {
|
|
// Disable Turbopack and use Webpack instead for compatibility
|
|
// This is necessary for server-side code that uses child_process
|
|
},
|
|
webpack: (config, { dev, isServer }) => {
|
|
if (dev && !isServer) {
|
|
config.watchOptions = {
|
|
poll: 1000,
|
|
aggregateTimeout: 300,
|
|
};
|
|
}
|
|
// Handle server-side modules
|
|
if (isServer) {
|
|
config.externals = config.externals || [];
|
|
if (!config.externals.includes('child_process')) {
|
|
config.externals.push('child_process');
|
|
}
|
|
}
|
|
return config;
|
|
},
|
|
// Ignore TypeScript errors during build (they can be fixed separately)
|
|
typescript: {
|
|
ignoreBuildErrors: true,
|
|
},
|
|
};
|
|
|
|
export default config;
|