https://github.com/xiaoxiaojx/next-clear-console
Clear console.log during production build in your Next.js project
https://github.com/xiaoxiaojx/next-clear-console
browser clear console console-log next nextjs plugin
Last synced: about 2 months ago
JSON representation
Clear console.log during production build in your Next.js project
- Host: GitHub
- URL: https://github.com/xiaoxiaojx/next-clear-console
- Owner: xiaoxiaojx
- Created: 2022-04-29T10:09:02.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-29T10:12:03.000Z (about 4 years ago)
- Last Synced: 2025-10-20T09:13:51.664Z (9 months ago)
- Topics: browser, clear, console, console-log, next, nextjs, plugin
- Language: JavaScript
- Homepage:
- Size: 1000 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Next.js + Clear Console.log
Clear console.log during production build in your Next.js project
## Installation
```
npm install --save next-clear-console
```
or
```
yarn add next-clear-console
```
### Usage
You can set the consoles to be cleared by using the pure_funcs field, This is to ensure that no logs are leaked from the user's browser console.
```js
// next.config.js
const withClearConsole = require("next-clear-console")({
// pure_funcs: ["console.log", "console.info", "console.warn", "console.error"]
pure_funcs: ["console.log", "console.info", "console.warn"],
});
module.exports = withClearConsole({
webpack(config, options) {
return config;
},
});
```