11/** @type {import('next').NextConfig } */
2- const isProd = process . env . NODE_ENV === 'production' ;
3-
4- // Allow overriding basePath/assetPrefix via env so we can deploy to domain root or a subfolder (e.g., /acm)
5- const envBasePath = process . env . NEXT_BASE_PATH ; // e.g. "/acm" or undefined for root
6- const basePath = envBasePath && envBasePath !== '/' ? envBasePath : undefined ;
7- const assetPrefix = process . env . NEXT_ASSET_PREFIX || ( basePath ? `${ basePath } /` : undefined ) ;
8-
92const nextConfig = {
10- // Dynamic deployment - no static export
3+ // Dynamic deployment - keep all features
114 // output: "export", // static export
125 // images: { unoptimized: true }, // needed when exporting
136
@@ -16,21 +9,16 @@ const nextConfig = {
169 domains : [ "localhost" , "csulb.acm.org" ] , // Add your domain here
1710 } ,
1811
19- // Only set when provided
20- ...( basePath ? { basePath } : { } ) ,
21- ...( assetPrefix ? { assetPrefix } : { } ) ,
22-
23- // Memory optimization for cPanel/low-memory environments
24- experimental : {
25- // Reduce memory usage during build
26- memoryBasedWorkers : false ,
27- } ,
12+ // Configure for subfolder deployment
13+ basePath : "/acm" ,
14+ assetPrefix : "/acm/" ,
2815
29- // Webpack optimization for memory (client-side only)
16+ // Webpack optimization for memory
3017 webpack : ( config , { isServer } ) => {
3118 if ( ! isServer ) {
19+ // Reduce memory usage for client-side build
3220 config . optimization . splitChunks = {
33- chunks : ' all' ,
21+ chunks : " all" ,
3422 cacheGroups : {
3523 default : {
3624 minChunks : 1 ,
@@ -39,15 +27,18 @@ const nextConfig = {
3927 } ,
4028 vendor : {
4129 test : / [ \\ / ] n o d e _ m o d u l e s [ \\ / ] / ,
42- name : ' vendors' ,
30+ name : " vendors" ,
4331 priority : - 10 ,
44- chunks : ' all' ,
32+ chunks : " all" ,
4533 } ,
4634 } ,
4735 } ;
4836 }
4937 return config ;
5038 } ,
51- } ;
5239
53- export default nextConfig ;
40+ // If deploying to root:
41+ // basePath: '/',
42+ // assetPrefix: '/',
43+ } ;
44+ export default nextConfig ;
0 commit comments