Refactor basePath and assetPrefix in next.config.ts for improved readability
This commit is contained in:
@@ -2,13 +2,16 @@ import type {NextConfig} from "next";
|
|||||||
|
|
||||||
const isProd = process.env.NODE_ENV === 'production';
|
const isProd = process.env.NODE_ENV === 'production';
|
||||||
|
|
||||||
|
const basePath = isProd ? '/lawfirm/demo1' : '';
|
||||||
|
const assetPrefix = isProd ? '/lawfirm/demo1' : '';
|
||||||
|
|
||||||
console.log(`🚀 [next.config.ts] Running in ${process.env.NODE_ENV} mode`);
|
console.log(`🚀 [next.config.ts] Running in ${process.env.NODE_ENV} mode`);
|
||||||
console.log(`👉 basePath: ${isProd ? '/lawfirm/demo1' : '(none)'}`);
|
console.log(`👉 basePath: ${basePath || '(none)'}`);
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
output: 'standalone',
|
output: 'standalone',
|
||||||
basePath: isProd ? '/lawfirm/demo1' : '',
|
basePath,
|
||||||
assetPrefix: isProd ? '/lawfirm/demo1' : '',
|
assetPrefix,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
|||||||
Reference in New Issue
Block a user