-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
53 lines (50 loc) · 1.32 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
const path = require("path");
const fs = require("fs");
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true", // 当设置了 ANALYZE 环境变量时启用
});
/** @type {import('next').NextConfig} */
const nextConfig = withBundleAnalyzer({
debug: true,
productionBrowserSourceMaps: false,
transpilePackages: [
"antd",
"@ant-design",
"rc-util",
"rc-pagination",
"rc-picker",
"rc-notification",
"rc-tooltip",
"rc-tree",
"rc-table",
"@ant-design/icons",
],
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"],
});
config.resolve.alias["@"] = path.resolve("./");
config.resolve.alias["~"] = path.resolve("./public");
return config;
},
sassOptions: {
includePaths: [path.join(__dirname, ""), path.join(__dirname, "public")],
},
async rewrites() {
return [
// request proxy
{
source: "/text-api/:path*",
destination: "https://35.77.218.53:9101/:path*",
},
];
},
// devServer: {
// https: {
// key: fs.readFileSync(path.join(__dirname, "key.pem")),
// cert: fs.readFileSync(path.join(__dirname, "cert.pem")),
// },
// },
});
module.exports = nextConfig;