-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
executable file
·44 lines (37 loc) · 1.29 KB
/
next.config.js
File metadata and controls
executable file
·44 lines (37 loc) · 1.29 KB
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
/** @type {import('next').NextConfig} */
const withPlugins = require('next-compose-plugins');
const TerserPlugin = require('terser-webpack-plugin');
const path = require('path');
const { ANALYZE, NEXT_PUBLIC_APP_ENV } = process.env;
const pluginConfig = require('./build.config/plugin');
const development = require('./build.config/development');
const production = require('./build.config/production');
const baseConfig = ANALYZE === 'true' || NEXT_PUBLIC_APP_ENV === 'production' ? production : development;
/** @type {import('next').NextConfig} */
const nextConfig = {
...baseConfig,
reactStrictMode: false,
devIndicators: {
autoPrerender: true,
},
webpack: (config, { webpack }) => {
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
});
config.plugins.push(
new webpack.IgnorePlugin({
resourceRegExp: /^electron$/,
}),
);
config.optimization.minimize = true;
config.optimization.minimizer.push(new TerserPlugin());
config.ignoreWarnings = [{ module: /node_modules/ }];
config.resolve.alias['antd5'] = path.resolve(__dirname, 'node_modules/@aelf-design/common/node_modules/antd');
return config;
},
typescript: {
ignoreBuildErrors: true,
},
};
module.exports = withPlugins(pluginConfig, nextConfig);