Next.js configuration
In order to initialize empty project use the following command:
Please change also build directory to `dist` in next.config.js or use -o flag in export command
So, the scripts section in package.json should look like this:
"scripts": {
"dev": "next dev",
"build": "next build & next export -o dist/",
"start": "next start"
}
Once you finish building your project, use the following command to deploy it:
If you are publishing for the first time, CLI will ask you few initial questions like
Once you successfully publish your project they will be stored for a future.
Note: Since frontend
is a default value for
publish
command, you can run just mdb publish
(instead of
mdb frontend publish
)
Remember: Project build must be exported to dist
directory.
Default directory for Next.js is out
and if you leave it, you project wouldn't work!
Next using Node.js to handle server-side rendering, that's why we need to publish project with node
Once you finish building your project, use the following command to deploy it:
If you are publishing for the first time, CLI will ask you few initial questions like
Once you successfully publish your project they will be stored for a future.
Remember: Project port must be set to 3000