# babel-plugin-helper-debug **Repository Path**: kezhongfa/babel-plugin-helper-debug ## Basic Information - **Project Name**: babel-plugin-helper-debug - **Description**: a babel plugin for debug - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-03-22 - **Last Updated**: 2023-06-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # babel-plugin-helper-debug a babel plugin for debug ## why Sometimes we need to write some logic code in some environment.This plugin is to solve this problem. ## Install ```shell npm i babel-plugin-helper-debug ``` ## Usage babel.config.js options - varName: variable name,default('\_\_DEBUG\_\_') - remove: removable,default(false) ```js // babel.config.js module.exports = { plugins: [ [ "helper-debug", { varName: "__DEBUG__", remove: process.env.NODE_ENV === "production" }, ], ], }; ``` in you code ```js if (__DEBUG__) { // for debug console.log("debug test"); } ``` when you use eslint ```js // .eslintrc.js module.exports = { globals: { __DEBUG__: true, }, }; ```