Reputation: 21
Trying to create prod build with npm run build
but it outputs to
info - Creating an optimized production build info - Compiled successfully info - Collecting page data info - Generating static pages (5/5) info - Finalizing page optimization Page Size First Load JS
┌ ○ / 261 B 222 kB
├ /_app 0 B 222 kB
├ ○ /404 194 B 222 kB
├ ○ /dashboard 236 B 222 kB
└ ○ /sign-in 514 B 222 kB
First Load JS shared by all 222 kB
├ chunks/framework-5f4595e5518b5600.js 42 kB
├ chunks/main-c586b89e07064d4a.js 27.9 kB
├ chunks/pages/_app-ff5b9dd4b852de7e.js 150 kB
└ chunks/webpack-d3b4bbaea9693629.js 1.72 kB
○(Static) automatically rendered as static HTML (uses no initial props)
What is missing here? i dont see any build folder in project root, also is it successfull or not?
tried to npm run build
Expecting : successfull build and build folder in project root
Upvotes: 2
Views: 2908
Reputation: 1
To enable a static export, change the output mode inside next.config.js
:
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
output: 'export',
}
module.exports = nextConfig
After running next build
, Next.js will produce an out
folder which contains the HTML/CSS/JS assets for your application.
For reference check out the Next JS Documentation
Upvotes: 0
Reputation: 6123
The "normal" output folder after next build
would be /.next
, which is not supposed to be touched during normal development, but instead should be used automatically by next.js with its included server, usually started with next start
.
Alternatively you can create a static build with next export
, and specify a custom output folder, but you have to setup a server yourself then.
Upvotes: 0