How i can run nextjs application build locally for static export? #79029
Answered
by
MRanaGitHub
mayur-1234
asked this question in
Help
-
SummaryI've created nextjs using page route and i want to run build locally. means i want to run out directory locally. I've add following in next.config.mjs Additional informationconst nextConfig = {
output: 'export',
trailingSlash: true,
reactStrictMode: true,
} ExampleNo response |
Beta Was this translation helpful? Give feedback.
Answered by
MRanaGitHub
May 10, 2025
Replies: 1 comment
-
You can use tools like serve to quickly host your static files: Install serve globally (if you haven't already):
Navigate to your project directory and run:
or you can add following in your package.json script section
after that run |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mayur-1234
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use tools like serve to quickly host your static files:
Install serve globally (if you haven't already):
npm install -g serve
Navigate to your project directory and run:
serve out
or you can add following in your package.json script section
"serve": "next build && npx serve@latest out"
after that run
npm run serve
oryarn serve