Socket
Socket
Sign inDemoInstall

babel-plugin-ima-logger

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-ima-logger

The babel pluging that removes @ima/plugin-logger from source code at compilation time.


Version published
Weekly downloads
6
decreased by-14.29%
Maintainers
2
Weekly downloads
 
Created
Source

babel-plugin-ima-logger

babel-plugin-ima-logger removes call expressions and function names in import statements of @ima/plugin-logger plugin when used in production or when the plugin's remove option is set to true.

Installation


npm install babel-plugin-ima-logger --save-dev

// gulpConfig.js

var gulpConfig = require('@ima/gulp-tasks/gulpConfig.js');

gulpConfig.babelConfig.esVendor.plugins.push('ima-logger');
gulpConfig.babelConfig.vendor.plugins.push('ima-logger');
gulpConfig.babelConfig.serverApp.plugins.push('ima-logger');
gulpConfig.babelConfig.esApp.plugins.push('ima-logger');
gulpConfig.babelConfig.app.plugins.push('ima-logger');
gulpConfig.babelConfig.server.plugins.push('ima-logger');

What the plugin does

It removes call expressions

The following call expressions will be removed:

  • debug(...)
  • info(...)
  • log(...)
  • throwIf(...)
  • warn(...)

It replaces call expressions with 0

The following call expressions will be replaced by 0:

  • debugIf(...)
  • errorIf(...)
  • infoIf(...)
  • logIf(...)
  • rejectIf(...),
  • warnIf(...)

Removes function names from import statements of @ima/plugin-logger

The following function names will be removed from the import statements:

  • debug
  • debugIf
  • errorIf
  • info
  • infoIf
  • log
  • logIf
  • rejectIf
  • throwIf
  • warn
  • warnIf

Empty import statements of @ima/plugin-logger will be removed completely.

Options

remove

boolean, defaults to false

If it's set to true, the plugin removes the call expressions and the function names from import statements regardless of process.env.NODE_ENV value. If it's set to false, process.env.NOD_ENV must be 'prod' or 'production' so that the plugin could remove something.

Keywords

FAQs

Package last updated on 20 Jan 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc