Create web/next.config.js
Browse files- web/next.config.js +74 -0
web/next.config.js
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/** @type {import('next').NextConfig} */
|
2 |
+
const nextConfig = {
|
3 |
+
reactStrictMode: true,
|
4 |
+
swcMinify: true,
|
5 |
+
images: {
|
6 |
+
domains: [
|
7 |
+
'localhost',
|
8 |
+
'backgroundfx.pro',
|
9 |
+
'api.backgroundfx.pro',
|
10 |
+
'storage.googleapis.com',
|
11 |
+
'cdn.backgroundfx.pro',
|
12 |
+
],
|
13 |
+
formats: ['image/avif', 'image/webp'],
|
14 |
+
},
|
15 |
+
experimental: {
|
16 |
+
serverActions: true,
|
17 |
+
},
|
18 |
+
async headers() {
|
19 |
+
return [
|
20 |
+
{
|
21 |
+
source: '/:path*',
|
22 |
+
headers: [
|
23 |
+
{
|
24 |
+
key: 'X-DNS-Prefetch-Control',
|
25 |
+
value: 'on',
|
26 |
+
},
|
27 |
+
{
|
28 |
+
key: 'X-XSS-Protection',
|
29 |
+
value: '1; mode=block',
|
30 |
+
},
|
31 |
+
{
|
32 |
+
key: 'X-Frame-Options',
|
33 |
+
value: 'SAMEORIGIN',
|
34 |
+
},
|
35 |
+
{
|
36 |
+
key: 'X-Content-Type-Options',
|
37 |
+
value: 'nosniff',
|
38 |
+
},
|
39 |
+
{
|
40 |
+
key: 'Referrer-Policy',
|
41 |
+
value: 'origin-when-cross-origin',
|
42 |
+
},
|
43 |
+
],
|
44 |
+
},
|
45 |
+
]
|
46 |
+
},
|
47 |
+
async rewrites() {
|
48 |
+
return [
|
49 |
+
{
|
50 |
+
source: '/api/v1/:path*',
|
51 |
+
destination: `${process.env.API_URL || 'http://localhost:8000'}/api/v1/:path*`,
|
52 |
+
},
|
53 |
+
]
|
54 |
+
},
|
55 |
+
webpack: (config, { isServer }) => {
|
56 |
+
if (!isServer) {
|
57 |
+
config.resolve.fallback = {
|
58 |
+
fs: false,
|
59 |
+
net: false,
|
60 |
+
tls: false,
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
// Add support for importing SVGs as React components
|
65 |
+
config.module.rules.push({
|
66 |
+
test: /\.svg$/,
|
67 |
+
use: ['@svgr/webpack'],
|
68 |
+
})
|
69 |
+
|
70 |
+
return config
|
71 |
+
},
|
72 |
+
}
|
73 |
+
|
74 |
+
module.exports = nextConfig
|