Skip to content

Commit b34d24c

Browse files
committed
2 parents 0a0b661 + 2b2012b commit b34d24c

File tree

10 files changed

+439
-341
lines changed

10 files changed

+439
-341
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install deps
2020
run: npm ci
2121

22-
- name: Build Next.js app
22+
- name: Build Next.js app (Dynamic)
2323
env:
2424
NEXT_PUBLIC_BASE_URL: ${{ secrets.NEXT_PUBLIC_BASE_URL }}
2525
MONGODB_URI: ${{ secrets.MONGODB_URI }}
@@ -58,10 +58,11 @@ jobs:
5858
**/README.md
5959
**/.github/workflows/**
6060
**/deploy.sh
61+
**/build-static.js
6162
6263
- name: Notify deployment completion
6364
run: |
64-
echo "🚀 Deployment completed!"
65+
echo "🚀 Dynamic deployment completed!"
6566
echo "📝 Manual steps required:"
6667
echo " 1. Go to cPanel → Node.js Apps"
6768
echo " 2. Click 'Install Dependencies'"

next.config.mjs

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
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-
92
const 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: /[\\/]node_modules[\\/]/,
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

Comments
 (0)