-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
54 lines (50 loc) · 1.46 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
const path = require('path');
const { execSync } = require('child_process');
const pkg = require('./package.json')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.NEXT_ANALYZE ? process.env.NEXT_ANALYZE === 'true' : 'false',
});
let commitHash = "N/A";
let commitUrl = "N/A";
try {
commitHash = execSync("git show --format='%h' --no-patch").toString().trim().replaceAll("'","");
commitUrl = (pkg.repository && commitHash) ? `${pkg.repository}/commit/${commitHash}` : "N/A";
} catch {
// Nothing todo
}
module.exports = withBundleAnalyzer({
env: {
QUINTET_PRODUCT_NAME: pkg.name ? pkg.name : "N/A",
QUINTET_VERSION: pkg.version ? pkg.version : "N/A",
QUINTET_REPO: pkg.repository ? pkg.repository : "N/A",
QUINTET_COMMIT_HASH: commitHash,
QUINTET_COMMIT_URL: commitUrl,
QUINTET_RUNTIME: "Node.js",
QUINTET_RUNTIME_VERSION: process.version ? process.version : "N/A",
QUINTET_BUILD_AT: Math.floor(Date.now() / 1000)
},
/*
serverRuntimeConfig: {
runtime: process.version,
},
*/
trailingSlash: true,
sassOptions: {
includePaths: [path.join(__dirname, 'styles')]
},
experimental: {
scrollRestoration: true
},
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
images: {
unoptimized: true,
},
swcMinify: true,
poweredByHeader: false,
compress: false, // already gzipped with the `HTTP server`. No need with `Next.js`.
});