-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
34 lines (32 loc) · 1.05 KB
/
next.config.js
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
/** @type {import('next').NextConfig} */
const nextConfig = {
// Only use export in production, not in development
...(process.env.NODE_ENV === 'production' ? { output: 'export' } : {}),
images: {
unoptimized: true,
},
// Allow preview URLs to access resources
allowedDevOrigins: ['utensils-preview.loca.lt'],
// Enable hot reloading for the _pages directory
reactStrictMode: false, // Set to false to prevent double-rendering in development
// Tell webpack not to ignore the _pages directory
webpack: (config, { dev }) => {
if (dev) {
// Ensure webpack is watching the _pages directory
config.watchOptions = {
...config.watchOptions,
// Poll for changes every 300ms
poll: 300,
// Don't ignore the _pages directory
ignored: /node_modules/,
};
// Add the _pages directory to the watched paths
config.snapshot = {
...config.snapshot,
managedPaths: [/^(.+?[\\/]node_modules[\\/])(?!_pages)/],
};
}
return config;
},
}
module.exports = nextConfig