How to configure the build process in Next.js

Viewed 28

I've just started getting to know Next.js. I see that by default it compiles static HTML files to the server/pages directory inside .next parent directory and CSS files to the static/css directory. And it also creates the cache directory and some JSON files in the root of the .next directory.

How and where can I configure all that?

I mean to set up compiling the HTML and CSS files to one directory instead of two (or in the root of .next) and cancel creating JSON files and the cache dir and so on.

Regarding next.config.js in the nextjs.org/docs, I only see how to specify custom build directory instead of the .next dir.

1 Answers

You need to tweak the next.config.js file to achieve this. Read out the official NextJs docs to learn more about config here

Related