1. Delete console and debugger implementations when compiling
Override the console.log method globally to judge the compilation environment. Only in the development environment, console.log will be executed, otherwise it will not be executed. The disadvantage cannot be solved by deleting the debugger. At the same time, the console in the code is not deleted, but it is not executed, and it is not recommended to use it.
Taro uses Webpack for packaging, so you can use Webpack plug-ins to delete console and debugger.