4.0.1 • Published 1 year ago

babel-plugin-ima-logger v4.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
1 year ago

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.

5.0.0-rc.0

1 year ago

5.0.0-rc.1

1 year ago

5.0.0-rc.2

1 year ago

4.0.1

1 year ago

4.0.0

1 year ago

4.0.0-rc.9

1 year ago

4.0.0-rc.8

2 years ago

4.0.0-rc.3

2 years ago

4.0.0-rc.2

2 years ago

4.0.0-rc.5

2 years ago

4.0.0-rc.4

2 years ago

4.0.0-rc.7

2 years ago

4.0.0-rc.6

2 years ago

4.0.0-rc.1

2 years ago

3.1.0-rc.0

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.0

4 years ago