-
Notifications
You must be signed in to change notification settings - Fork 8
/
next.config.js
109 lines (102 loc) · 5.18 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// @ts-check
const path = require('path');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const withPlugins = require('next-compose-plugins');
const { patchWebpackConfig: patchForGlobalCSS } = require('next-global-css');
const withTranspileModules = require('next-transpile-modules')([]);
const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin');
/**
* @type {import('next').NextConfig}
**/
module.exports = withPlugins([withTranspileModules], {
webpack: (config, options) => {
// These 'react' related configs are added to enable linking packages in development
// (e.g. Arranger), and not get the "broken Hooks" warning.
// https://reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react
if (options.isServer) {
config.externals = ['react', ...config.externals];
} else {
options.dev &&
config.plugins.push(new ForkTsCheckerWebpackPlugin()) &&
config.plugins.push(
new ExtraWatchWebpackPlugin({
dirs: [path.resolve(__dirname, '.', 'node_modules', 'react')],
}),
);
}
config.resolve.alias['@emotion/react'] = path.resolve(
__dirname,
'.',
'node_modules',
'@emotion/react',
);
config.resolve.alias['react'] = path.resolve(__dirname, '.', 'node_modules', 'react');
process.env.NODE_ENV === 'development' && (config.optimization.minimize = false);
return patchForGlobalCSS(config, options);
},
publicRuntimeConfig: {
EGO_PUBLIC_KEY: (process.env.EGO_PUBLIC_KEY || '').replace(/\\n/g, '\n'),
NEXT_PUBLIC_ADMIN_EMAIL: process.env.NEXT_PUBLIC_ADMIN_EMAIL,
NEXT_PUBLIC_APP_COMMIT: process.env.APP_COMMIT,
NEXT_PUBLIC_APP_VERSION: process.env.APP_VERSION,
NEXT_PUBLIC_ARRANGER_SEQUENCES_ADMIN_UI:
process.env.NEXT_PUBLIC_ARRANGER_SEQUENCES_ADMIN_UI_URL,
NEXT_PUBLIC_ARRANGER_SEQUENCES_API: process.env.NEXT_PUBLIC_ARRANGER_SEQUENCES_API_URL,
NEXT_PUBLIC_ARRANGER_SEQUENCES_DOCUMENT_TYPE:
process.env.NEXT_PUBLIC_ARRANGER_SEQUENCES_DOCUMENT_TYPE,
NEXT_PUBLIC_ARRANGER_SEQUENCES_INDEX: process.env.NEXT_PUBLIC_ARRANGER_SEQUENCES_INDEX,
NEXT_PUBLIC_ARRANGER_SEQUENCES_CARDINALITY_PRECISION_THRESHOLD:
process.env.NEXT_PUBLIC_ARRANGER_SEQUENCES_CARDINALITY_PRECISION_THRESHOLD || 3000,
NEXT_PUBLIC_ARRANGER_SEQUENCES_MANIFEST_COLUMNS:
process.env.NEXT_PUBLIC_ARRANGER_SEQUENCES_MANIFEST_COLUMNS || '',
NEXT_PUBLIC_ARRANGER_SEQUENCES_MAX_BUCKET_COUNTS:
process.env.NEXT_PUBLIC_ARRANGER_SEQUENCES_MAX_BUCKET_COUNTS || 1000,
NEXT_PUBLIC_ARRANGER_WASTEWATER_ADMIN_UI:
process.env.NEXT_PUBLIC_ARRANGER_WASTEWATER_ADMIN_UI_URL,
NEXT_PUBLIC_ARRANGER_WASTEWATER_API: process.env.NEXT_PUBLIC_ARRANGER_WASTEWATER_API_URL,
NEXT_PUBLIC_ARRANGER_WASTEWATER_DOCUMENT_TYPE:
process.env.NEXT_PUBLIC_ARRANGER_WASTEWATER_DOCUMENT_TYPE,
NEXT_PUBLIC_ARRANGER_WASTEWATER_INDEX: process.env.NEXT_PUBLIC_ARRANGER_WASTEWATER_INDEX,
NEXT_PUBLIC_ARRANGER_WASTEWATER_CARDINALITY_PRECISION_THRESHOLD:
process.env.NEXT_PUBLIC_ARRANGER_WASTEWATER_CARDINALITY_PRECISION_THRESHOLD || 3000,
NEXT_PUBLIC_ARRANGER_WASTEWATER_MANIFEST_COLUMNS:
process.env.NEXT_PUBLIC_ARRANGER_WASTEWATER_MANIFEST_COLUMNS || '',
NEXT_PUBLIC_ARRANGER_WASTEWATER_MAX_BUCKET_COUNTS:
process.env.NEXT_PUBLIC_ARRANGER_WASTEWATER_MAX_BUCKET_COUNTS || 1000,
// using ASSET_PREFIX for the public runtime BASE_PATH because basePath in the top level config was not working
// with the dms reverse proxy setup
NEXT_PUBLIC_BASE_PATH: process.env.ASSET_PREFIX || '/',
NEXT_PUBLIC_CHANGELOG_START_SECONDS: process.env.NEXT_PUBLIC_CHANGELOG_START_SECONDS,
NEXT_PUBLIC_DOWNLOAD_ALL_URL: process.env.NEXT_PUBLIC_DOWNLOAD_ALL_URL,
NEXT_PUBLIC_EGO_API_URL: process.env.NEXT_PUBLIC_EGO_API_URL,
NEXT_PUBLIC_EGO_CLIENT_ID: process.env.NEXT_PUBLIC_EGO_CLIENT_ID,
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID: process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID,
NEXT_PUBLIC_KEYCLOAK: process.env.NEXT_PUBLIC_KEYCLOAK_API_URL,
NEXT_PUBLIC_LAB_NAME: process.env.NEXT_PUBLIC_LAB_NAME,
NEXT_PUBLIC_LOGO_FILENAME: process.env.NEXT_PUBLIC_LOGO_FILENAME,
NEXT_PUBLIC_MUSE_API: process.env.NEXT_PUBLIC_MUSE_API_URL,
NEXT_PUBLIC_PORTAL_API_URL: process.env.NEXT_PUBLIC_PORTAL_API_URL,
NEXT_PUBLIC_RELEASE_DATE: process.env.NEXT_PUBLIC_RELEASE_DATE,
NEXT_PUBLIC_SCOPE_MUSE_STUDY_SYSTEM_WRITE:
process.env.NEXT_PUBLIC_SCOPE_MUSE_STUDY_SYSTEM_WRITE,
NEXT_PUBLIC_SCOPE_STUDY_SVC_WRITE: process.env.NEXT_PUBLIC_SCOPE_STUDY_SVC_WRITE,
NEXT_PUBLIC_SINGULARITY_API_URL: process.env.NEXT_PUBLIC_SINGULARITY_API_URL,
NEXT_PUBLIC_SSO_PROVIDERS: process.env.NEXT_PUBLIC_SSO_PROVIDERS,
NEXT_PUBLIC_STUDIES_SVC_URL: process.env.NEXT_PUBLIC_STUDIES_SVC_URL,
NEXT_PUBLIC_SYSTEM_ALERTS: process.env.NEXT_PUBLIC_SYSTEM_ALERTS,
// Optional features/functionalities
NEXT_PUBLIC_DEBUG: process.env.NEXT_PUBLIC_DEBUG,
NEXT_PUBLIC_ENABLE_DOWNLOADS: process.env.NEXT_PUBLIC_ENABLE_DOWNLOADS,
NEXT_PUBLIC_ENABLE_LOGIN: process.env.NEXT_PUBLIC_ENABLE_LOGIN,
NEXT_PUBLIC_ENABLE_QUICKSEARCH: process.env.NEXT_PUBLIC_ENABLE_QUICKSEARCH,
NEXT_PUBLIC_ENABLE_REGISTRATION: process.env.NEXT_PUBLIC_ENABLE_REGISTRATION,
},
assetPrefix: process.env.ASSET_PREFIX || '',
redirects: async () => [
// {
// source: '/about',
// destination: '/',
// permanent: true,
// },
],
});