You may be wondering where what is the build process and how exactly it works and affects you as a developer. In this article, we’ll take a quick look into how you can build your application and why you may want to do so at some point.
So what is build? The build is the process which creates (or builds) the optimized production version of your application that is ready for deployment. If you worked on bigger projects then this was handled by processes set up by other engineers in the background and if you’re just learning to code, then you don’t need to build your application to run it locally.
So to sum up, build is the process and the output that you then deploy to make your application available via public URLs.
Build
To build your NextJS project you need to run the build command
$ npm run build
in the root directory of your project. This will generate the .next folder.
All of the code and files located withing that folder has been processed specifically to allow browsers use it more efficiently.
Side note
When generating the build for the point of the article I came up with the below error
error - ESLint must be installed in order to run during builds: yarn add --dev eslint
I managed to solve it by updating the next.config.js file with the below code.
module.exports = {
reactStrictMode: true,
eslint: {
ignoreDuringBuilds: true,
},
}
Make sure that you do the same for your application in you’re facing that error.
💬 Leave a comment