Skip to content

Commit

Permalink
update for production
Browse files Browse the repository at this point in the history
  • Loading branch information
Sivamani-18 committed Jul 29, 2024
1 parent 655a867 commit d11102c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
16 changes: 7 additions & 9 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
// Set the basePath to your repository name if it's not the root domain
basePath: '/nextjs-boilerplate', // Replace 'your-repo-name' with the actual name of your GitHub repository

// Set the assetPrefix to serve assets correctly
assetPrefix: '/nextjs-boilerplate/', // Ensure this matches your basePath
const isProd = process.env.NODE_ENV === 'production';

// Enable trailing slash to ensure paths work correctly
const nextConfig = {
output: 'export',
basePath: isProd ? '/nextjs-boilerplate' : '', // Use an empty string for development
assetPrefix: isProd
? 'https://sivamani-18.github.io/nextjs-boilerplate/'
: undefined,
trailingSlash: true,

// Optional: other Next.js configurations can go here
};

export default nextConfig;
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"export": "next export"
},
"dependencies": {
"react": "^18",
Expand Down

0 comments on commit d11102c

Please sign in to comment.