forked from daodaoedu/daodao-f2e
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
36 lines (33 loc) · 878 Bytes
/
next.config.js
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
const isDev = process.env.NODE_ENV === 'development';
const withPWA = require('next-pwa')({
dest: 'public',
});
/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: false,
staticPageGenerationTimeout: 600,
transpilePackages: ['@mdxeditor/editor'],
images: {
domains: ['imgur.com', 'images.unsplash.com', 'lh3.googleusercontent.com'],
},
webpack: (config) => {
const experiments = { ...config.experiments, topLevelAwait: true };
return Object.assign(config, { experiments });
},
env: {
HOSTNAME: 'https://www.daoedu.tw',
},
...(isDev
? {
async rewrites() {
return [
{
source: '/dev-proxy-api/:path*',
destination: `${process.env.NEXT_PUBLIC_API_URL}/:path*`,
},
];
},
}
: {}),
};
module.exports = withPWA(config);