1.0.3 • Published 3 years ago

babel-plugin-clear-unused-import v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

babel-plugin-clear-unused-import

Install

npm install --save babel-plugin-clear-unused-import

Usage

// Input
import _ from 'lodash';
import { funcA, funcB } from './util';
import * as CONSTANT from './constant';

export default function () {
    funcA();
}

// Output
import { funcA } from './util';

export default function () {
  funcA();
}

Options

{
    // ignore some import modules?
    ignore = ['react'] | 'react' | function (value) {
        return value === 'react';
    }: Array | String | Function,
}

Note

Plugins could be unsafe because some modules have side effects.