0

I'm using Next.Js for a website project And I wondered if it is possible to use "next export" with dynamic routes without using getStaticPath? Because my project needs routes like this:

www.Test.com/USERNAME

That username is specific for each person but the problem is if I use getStaticPath it will create an HTML file for each person which is not efficient

Is it a way to export the project with a dynamic route and not create HTML for each element?

juliomalves
  • 42,130
  • 20
  • 150
  • 146
  • Does this answer your question: [Next.js dynamic page params for static export](https://stackoverflow.com/questions/55339636/next-js-dynamic-page-params-for-static-export)? – juliomalves Jul 06 '22 at 21:04

1 Answers1

-2

If I am not wrong,

Car folder with following files

  • [id].js
  • index.js

[id].js file is dynamic. it takes dynamic routes so:

www.test.com/car => index.js

www.test.com/car/porshe => [id].js. -> id is porshe

www.test.com/car/tesla => [id].js. -> id is tesla

bnays mhz
  • 425
  • 2
  • 7