Configure next.config.ts for production and development: set basePath, assetPrefix, enable standalone output, and add environment logging.
This commit is contained in:
@@ -1,7 +1,17 @@
|
|||||||
import type {NextConfig} from "next";
|
import type {NextConfig} from "next";
|
||||||
|
|
||||||
|
const isProd = process.env.NODE_ENV === 'production';
|
||||||
|
|
||||||
|
export const basePath = isProd ? '/lawfirm/demo3' : '';
|
||||||
|
export const assetPrefix = isProd ? '/lawfirm/demo3' : '';
|
||||||
|
|
||||||
|
console.log(`🚀 [next.config.ts] Running in ${process.env.NODE_ENV} mode`);
|
||||||
|
console.log(`👉 basePath: ${basePath || '(none)'}`);
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
/* config options here */
|
output: 'standalone',
|
||||||
|
basePath,
|
||||||
|
assetPrefix,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
|||||||
Reference in New Issue
Block a user