-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
60 lines (52 loc) · 1.35 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/** @type {import('next').NextConfig} */
import path from "path";
import { fileURLToPath } from "url";
const __dirname = fileURLToPath(import.meta.url);
const prefix =
process.CDN === true
? "https://d2dfipunm8t5y9.cloudfront.net/ingroup-official"
: undefined;
console.log(path.resolve(__dirname, "static/avatar"));
const nextConfig = {
future: {
webpack5: true,
},
reactStrictMode: true,
swcMinify: true,
publicRuntimeConfig: {
NODE_ENV: process.env.NODE_ENV,
MODE: process.env.MODE,
PUBLIC_PATH: process.env.PUBLIC_PATH,
},
assetPrefix: prefix,
// TODO: 临时测试
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
webpack: (config, { dev, isServer, buildId }) => {
return {
...config,
experiments: {
topLevelAwait: true,
asyncWebAssembly: true, // Enable webassembly
layers: true,
},
// resolve: {plugins:[PnpWebpackPlugin]},
// resolveLoader: {
// plugins: [PnpWebpackPlugin.moduleLoader(module)]
// }
};
},
// TODO: 设置代理
// async rewrites() {
// return [
// {
// source: '/api/:path*',
// destination: `http://172.31.30.249:8006/:path*`
// },
// ]
// },
};
export default nextConfig;