-
Notifications
You must be signed in to change notification settings - Fork 3
/
next.config.mjs
78 lines (72 loc) · 1.77 KB
/
next.config.mjs
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
import { env } from './src/env.mjs'
/** @type {import("next").NextConfig} */
const config = {
// transpilePackages: ['three'],
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'mjs', 'cjs', 'md', 'mdx'],
reactStrictMode: true,
images: {
domains: [
'www.mirea.ru',
'cdn.cms.mirea.ninja',
'lk.mirea.ru',
'avatars.githubusercontent.com',
env.NEXT_PUBLIC_CDN_ENDPOINT_URL.replace('https://', ''),
],
remotePatterns: [{ hostname: '*.googleusercontent.com' }],
},
...(env.NODE_ENV === 'production' && {
output: 'standalone',
compiler: {
removeConsole: {
exclude: ['error'],
},
},
}),
async headers() {
return [
{
source: '/me',
headers: [
{
key: 'Cache-Control',
value: 'no-store',
},
],
},
]
},
// async redirects() {
// return [
// {
// source: '/',
// destination: '/finds',
// permanent: false,
// },
// ]
// },
}
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: env.ANALYZE,
})
const withPWA = require('next-pwa')({
dest: 'public',
disable: env.DISABLE_PWA,
register: true,
scope: '/',
sw: 'service-worker.js',
})
const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
options: {
// If you use remark-gfm, you'll need to use next.config.mjs
// as the package is ESM only
// https://github.com/remarkjs/remark-gfm#install
remarkPlugins: [],
rehypePlugins: [],
// If you use `MDXProvider`, uncomment the following line.
// providerImportSource: "@mdx-js/react",
},
})
export default withPWA(withMDX(withBundleAnalyzer(config)))