Next.js Discord

Discord Forum

Exclude some routes in build time

Unanswered
Japanese pilchard posted this in #help-forum
Open in Discord
Japanese pilchardOP
Hi Guys, I'm new in next and I would like to know what is the best way to exclude a route when I generate the build. Currently I have for example the route directory and site-map but depending of a variable in my env.local I'd like to exclude one of them (In the env.local I have different variables depending on every client. I generate a build for every client).. For example if one client is type "SM", I should keep the route "site-map" and exclude "directory" and also the oposite case..
Currently I'm using next 14.0.4..

0 Replies