Repository navigation
Expand file tree
/
Copy pathnext.config.mjs
More file actions
59 lines (54 loc) · 1.58 KB
/
Copy pathnext.config.mjs
File metadata and controls
59 lines (54 loc) · 1.58 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
import MDX from '@next/mdx'
import PWA from 'next-pwa'
import defaultRuntimeCaching from 'next-pwa/cache.js'
import remarkPlugins from './plugins/index.mjs'
const withMDX = MDX({
extension: /\.mdx?$/,
options: {
remarkPlugins,
providerImportSource: '@mdx-js/react',
},
experimental: {
mdxRs: true,
},
})
const withPWA = PWA({
dest: 'public',
disable: process.env.NODE_ENV === 'development',
// The default rules match images by file extension, which never matches an
// Image CDN URL like `/.netlify/images?url=…&w=650`. Without this entry those
// renditions bypass the service worker cache and are refetched on every visit.
runtimeCaching: [
{
urlPattern: /\/\.netlify\/images\?.+$/i,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'netlify-image-cdn',
expiration: {
maxEntries: 64,
maxAgeSeconds: 30 * 24 * 60 * 60, // 30 days
},
},
},
...defaultRuntimeCaching,
],
})
/** @type {import('next').NextConfig} */
const nextConfig = withPWA(
withMDX({
reactStrictMode: true,
swcMinify: true,
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdx'],
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
images: { unoptimized: true },
env: {
DOCSEARCH_API_KEY: process.env.DOCSEARCH_API_KEY,
},
})
)
export default nextConfig