generated from erkobridee/nextjs-ssg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
38 lines (28 loc) · 848 Bytes
/
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
// @ts-check
/*
https://nextjs.org/docs/api-reference/next.config.js/introduction
https://nextjs.org/docs/api-reference/next.config.js/environment-variables
*/
const package = require('./package.json');
const VERSION = require('./scripts/compute-version');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const version = String(VERSION);
console.log(`\n\nRunning version: ${version}\n`);
const isProduction = 'production' === `${process.env.NODE_ENV}`;
const basePath = isProduction ? `/${package.name}` : '';
/**
* @type {import('next').NextConfig}
**/
const nextConfig = {
swcMinify: true,
trailingSlash: true,
reactStrictMode: true,
basePath,
env: {
ASSETS_PREFIX: basePath,
VERSION: version,
},
};
module.exports = withBundleAnalyzer(nextConfig);