-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
61 lines (52 loc) · 1.33 KB
/
next.config.js
File metadata and controls
61 lines (52 loc) · 1.33 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const { PHASE_PRODUCTION_BUILD } = require('next/constants');
const bundleAnalyzer = require('@next/bundle-analyzer')({
enabled: !!process.env.BUNDLE_ANALYZE,
});
const config = require('./config.json');
module.exports = (phase) => {
const isProd = phase === PHASE_PRODUCTION_BUILD;
const nodeEnv = (() => {
if (isProd) return 'production';
return 'development';
})();
console.log('🚀🚀 ENV: ', nodeEnv);
const env = {
SERVER_URI: config.SERVER_URI,
WEB_URI: config.WEB_URI,
HANDLE_DATE: config.HANDLE_DATE,
TOTAL_CHAIN: config.TOTAL_CHAIN,
};
console.log('env_log', env);
// next.config.js object
return bundleAnalyzer({
env,
sassOptions: {
// includePaths: ['./styles'],
prependData: `@import "./public/styles/base.scss";`,
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '**',
},
],
},
experimental: {
outputStandalone: true,
},
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ['@svgr/webpack'],
});
return config;
},
});
};