-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathnext.config.js
More file actions
35 lines (30 loc) · 854 Bytes
/
Copy pathnext.config.js
File metadata and controls
35 lines (30 loc) · 854 Bytes
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
const childProcess = require('child_process');
// eslint-disable-next-line @typescript-eslint/no-var-requires
const withNx = require('@nx/next/plugins/with-nx');
const commitHash = childProcess
.execSync('git rev-parse HEAD')
.toString()
.trim();
// Get the tag of the last commit
const commitLog = childProcess
.execSync('git log --decorate --oneline -1')
.toString()
.trim();
const tagMatch = commitLog.match(/tag: ([^,)]+)/);
const tag = tagMatch ? tagMatch[1] : '';
/**
* @type {import('@nx/next/plugins/with-nx').WithNxOptions}
**/
const nextConfig = {
nx: {
// Set this to true if you would like to to use SVGR
// See: https://github.com/gregberge/svgr
svgr: false,
},
pageExtensions: ['page.tsx', 'page.jsx'],
env: {
GIT_COMMIT: commitHash,
GIT_TAG: tag,
},
};
module.exports = withNx(nextConfig);