forked from stream-rec/stream-rec-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
39 lines (34 loc) · 1.05 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
import createNextIntlPlugin from 'next-intl/plugin';
import {readFileSync} from 'fs';
import {join} from 'path';
import {execSync} from "node:child_process";
const withNextIntl = createNextIntlPlugin();
// current git tag version
let gitVersion;
try {
gitVersion = execSync('git describe --tags --always --first-parent').toString().trim();
} catch (error) {
console.error('Error while extracting git version, parsing from package.json', error);
const packageJsonPath = join(process.cwd(), 'package.json');
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
gitVersion = packageJson.version;
}
let appVersion = gitVersion;
/** @type {import('next').NextConfig} */
const nextConfig = {
async redirects() {
return [
{
source: '/',
destination: '/dashboard',
permanent: true,
},
]
},
output: 'standalone',
env: {
APP_VERSION: appVersion,
MIN_SERVER_VERSION: "10455",
}
};
export default withNextIntl(nextConfig);