-
Notifications
You must be signed in to change notification settings - Fork 17
/
next.config.mjs
43 lines (35 loc) · 1.02 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
/* eslint-disable no-process-env */
// @ts-check
import { env } from './src/env.mjs';
/** @type {import('next').NextConfig} */
const nextConfig = {
output: env.NODE_ENV === 'production' ? 'standalone' : undefined,
typescript: {
// Handled during CI
ignoreBuildErrors: true,
},
eslint: {
// Handled during CI
ignoreDuringBuilds: true,
},
experimental: {
mdxRs: true,
},
};
/**
* @param {string} phase
* @param {{ defaultConfig: import('next').NextConfig }} options
*/
const nextConfigWithPlugins = async (phase, { defaultConfig }) => {
/* Dynamically import plugins from devDependencies to reduce bundle size */
const withBundleAnalyzer = (await import('@next/bundle-analyzer')).default({
enabled: env.ANALYZE,
});
const withPWA = (await import('@ducanh2912/next-pwa')).default({
dest: 'public',
disable: !env.PWA,
});
const withMDX = (await import('@next/mdx')).default();
return withBundleAnalyzer(withPWA(withMDX(nextConfig)));
};
export default nextConfigWithPlugins;