Back to Next Js

Remove Console Example

examples/remove-console/README.md

16.2.51.1 KB
Original Source

Remove Console Example

This example shows how to use the Next.js removeConsole config option to remove all console.* calls except console.error, or suppress all logs.

Deploy your own

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

bash
npx create-next-app --example remove-console remove-console-app
bash
yarn create next-app --example remove-console remove-console-app
bash
pnpm create next-app --example remove-console remove-console-app

Deploy it to the cloud with Vercel (Documentation).