Skip to content

Clear console.log during production build in your Next.js project

Notifications You must be signed in to change notification settings

xiaoxiaojx/next-clear-console

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

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.

// 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;
  },
});

About

Clear console.log during production build in your Next.js project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published