vscode console.log plugin

vscode console.log plugin

In the project, I often print data for debugging. It is troublesome to type console.log every time. (Browser Sources breakpoints are more suitable for complex and asynchronous debugging bugs) I
found a vscode plug-in javascript console utils

Installation
Insert picture description here
Method of use, select variables at will

ctrl shift + L
Insert picture description here
can also use ctrl shift + D to delete all console.logs on this page with one click

Here is another plug-in babel-plugin-transform-remove-console to remove console.log in the production environment project code

installation

npm install babel-plugin-transform-remove-console --save-dev

Modify babel.config.js

const IS_PROD=process.env.NODE_ENV==='production' // 判断是否是production环境
const plugins=[]
if(IS_PROD){
    
    
    plugins.unshift(['transform-remove-console'],{
    
    exclude:['error']})
}

Guess you like

Origin blog.csdn.net/weixin_43881166/article/details/115307217