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
Method of use, select variables at will
ctrl shift + L
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']})
}