From the course: Master Next.js: Elaborate Hands-On Web Development, React Basics, Advanced Next.js, and Deployment

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

What is bundling in Next.js?

What is bundling in Next.js?

Okay, another reason why Next.js is a fantastic framework for React is because of bundling. All right, bundling, bundling. Next.js is bundler. All right, so why do you want to bundle code? What is bundling code and why would you want to bundle it? And why do we care that Next.js is bundling code for us? So when we build our Next.js project for production, we have all these files, We've got the JavaScript files, we've got this TypeScript, CSS which is for our styling, our HTML file. So these bundled files are basically what you deploy to hosting platforms, right? Which if that doesn't make sense to you, we're going to do it together at the end of the final project. But for now, realize that when you're actually moving to production, you're bundling files. Now, you do bundle in a development environment as well, but it's not really optimized because you prioritize fast reload time, source maps, other tools to aid in debugging. But when you move to production, like we said in the…

Contents