Repository navigation
Expand file tree
/
Copy pathnext.config.mjs
More file actions
74 lines (71 loc) · 1.5 KB
/
Copy pathnext.config.mjs
File metadata and controls
74 lines (71 loc) · 1.5 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
const isStaticExport = 'false';
import withPWAInit from '@ducanh2912/next-pwa';
const withPWA = withPWAInit({
dest: 'public',
disable: process.env.NODE_ENV === 'development', // Disable in dev to speed up workflow
register: true,
skipWaiting: true,
});
const nextConfig = {
trailingSlash: false,
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
compress: true,
poweredByHeader: false,
reactStrictMode: true,
env: {
BUILD_STATIC_EXPORT: isStaticExport,
},
images: {
formats: ['image/avif', 'image/webp'],
remotePatterns: [
{
protocol: 'https',
hostname: 'image.tmdb.org',
},
{
protocol: 'https',
hostname: '**.tmdb.org',
},
],
},
modularizeImports: {
'@mui/icons-material': {
transform: '@mui/icons-material/{{member}}',
},
'@mui/material': {
transform: '@mui/material/{{member}}',
},
'@mui/lab': {
transform: '@mui/lab/{{member}}',
},
},
turbopack: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
},
},
},
async headers() {
return [
{
source: '/embed/:path*',
headers: [
{
key: 'Content-Security-Policy',
value: 'frame-ancestors *',
},
{
key: 'Access-Control-Allow-Origin',
value: '*',
},
],
},
];
},
...(isStaticExport === 'true' && {
output: 'export',
}),
};
export default withPWA(nextConfig);