babel-plugin-strip-module
Babel plugin that will remove certain module usage from code.
Using this plugin might be dangourse as it will remove code that you might want to keep. Use at your own risk.
Examples
Suppose you would like to remove certain validation library in production code. Here is what this plugin can do:
In
; const validation = paramTypes; { ; console;} ;
Out
/* import * as paramTypes from 'param-types'; */ /* * const validation = paramTypes.validate( * 'function validation', * paramTypes.string.isRequired, * paramTypes.number.isRequired * ); */ { /* validate(paramA, paramB); */ console;} ;
Installation
$ npm install babel-plugin-strip-module
Usage
.babelrc
(Recommended)
Via .babelrc
Via Node API
;
License
MIT