🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

babel-plugin-code-cleaner

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-code-cleaner

babel code cleaner, removes specified console & debugger debugging code

latest
Source
npmnpm
Version
0.1.3
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-code-cleaner

babel代码清洁工,删除指定的调试代码:console & debugger

插件安装

npm install babel-plugin-code-cleaner -D

babel配置

babel.config.js

{
  "plugins": ["babel-plugin-code-cleaner"]
}

添加配置参数

{
  "plugins": [["code-cleaner", {
    "env": "production", // 始终执行cleaner
    "ignoreDebug": true, // 忽略 debugger的清除
    "commentWord": "@ignore-code-cleaner" // 默认值
  }]]
}

配置项

参数类型默认值介绍
envstringenv === 'production',则始终执行cleaner
ignoreDebugbooleanfalse跳过debugger的cleaner
commentWordstring@ignore-code-cleaner遇到注释跳过cleaner,类似于 // @ts-ignore

Keywords

babel

FAQs

Package last updated on 01 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts