-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.mjs
63 lines (56 loc) · 1.53 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
// import withPlugins from 'next-compose-plugins'
import MDX from '@next/mdx'
import PWA from 'next-pwa'
const {
NEXT_PUBLIC_SENTRY_DSN: SENTRY_DSN,
SENTRY_ORG,
SENTRY_PROJECT,
SENTRY_AUTH_TOKEN,
NODE_ENV,
VERCEL_GIT_COMMIT_SHA,
} = process.env
process.env.SENTRY_DSN = SENTRY_DSN
const Config = async (phase, { defaultConfig }) => {
/**
* @type {import('next').NextConfig}
*/
const config = {
// topLevelAwait: true,
productionBrowserSourceMaps: true,
// target: 'serverless',
env: {
// Make the COMMIT_SHA available to the client so that Sentry events can be
// marked for the release they belong to. It may be undefined if running
// outside of Vercel
buildTime: new Date().toDateString(),
NEXT_PUBLIC_COMMIT_SHA: VERCEL_GIT_COMMIT_SHA ?? "",
},
images: {
domains: ['blog.kochie.io', 'holopin.io', 'assets.holopin.io'],
},
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
experimental: {
mdxRs: true,
webpackBuildWorker: true
},
}
const withMDX = MDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [],
rehypePlugins: [],
// If you use `MDXProvider`, uncomment the following line.
// providerImportSource: '@mdx-js/react',
// development: true,
},
})
const withPWA = PWA({
dest: 'public',
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024,
})
if (process.NODE_ENV === 'production') {
return withPWA(withMDX(config))
}
return withMDX(config)
}
export default Config