Customizing Babel Config

    Next.js includes the preset to your app, which includes everything needed to compile React applications and server-side code. But if you want to extend the default Babel configs, it’s also possible.

    To start, you only need to define a .babelrc file (or babel.config.js) at the top of your app. If such a file is found, it will be considered as the source of truth, and therefore it needs to define what Next.js needs as well, which is the preset.

    You can to learn about the presets included by next/babel.

    To add presets/plugins without configuring them, you can do it this way:

    To learn more about the available options for each config, visit their documentation site.