-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathnext.config.mjs
52 lines (47 loc) · 1.39 KB
/
next.config.mjs
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
// next.config.js
/** @type {import('next').NextConfig} */
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const BUILD_OUTPUT =
process.env.NEXT_CONFIG_BUILD_OUTPUT === 'standalone'
? 'standalone'
: undefined;
const nextConfig = {
webpack: (config) => {
config.resolve.alias = {
...config.resolve.alias,
'@': path.resolve(__dirname, './src'),
};
return config;
},
redirects: async () => {
// TODO - load tabs configs here to dynamically define redirects
return [
{
// This regex matches paths that try to load a domain or workflow without specifying the active cluster
source:
'/domains/:path((?:[^/]+)(?:/(?:workflows|metadata|settings|archival|task-lists)(?:/.*)?)?)',
destination: '/redirects/domain/:path',
permanent: true,
},
{
source: '/domains/:domain/:cluster',
destination: '/domains/:domain/:cluster/workflows',
permanent: true,
},
{
source: '/domains/:domain/:cluster/workflows/:workflowId/:runId',
destination:
'/domains/:domain/:cluster/workflows/:workflowId/:runId/summary',
permanent: true,
},
];
},
output: BUILD_OUTPUT,
experimental: {
instrumentationHook: true,
},
};
export default nextConfig;