This project has been deprecated in favor of @netlify/plugin-nextjs
Enable Next.js dynamic routes on Netlify.
Plugin source code can be found here
-
Install the dependency from
npm
npm install @netlify/plugin-next
-
Then add the following lines to your
netlify.toml
file:[[plugins]] package = "@netlify/plugin-next"
-
Ensure that your
next.config.js
has thetarget
set toserverless
// next.config.js module.exports = { // Target must be serverless target: 'serverless' };
-
Ensure the following values in
netlify.toml
.build
command
isnext build
, or running it under the hood.function
dir is set toout_functions
publish
dir is set toout_publish
[build] command = "next build" functions = "out_functions" publish = "out_publish"
Config should ultimately look something like:
[build]
command = "npm run build"
functions = "out_functions"
publish = "out_publish"
[[plugins]]
package = "@netlify/plugin-next"