babel-plugin-danger-remove-unused-imports
v2.1.3
Published
> Fork from `babel-plugin-danger-remove-unused-import` and `babel-plugin-remove-unused-imports`, Support remove unused `require`.
Downloads
258
Maintainers
Readme
babel-plugin-danger-remove-unused-imports
Fork from
babel-plugin-danger-remove-unused-import
andbabel-plugin-remove-unused-imports
, Support remove unusedrequire
.
For shrinking the bundled javascript size :smile:
Note: remove unused import is dangerous because the imported package may have some side effects!
Option
{
ignore: ['react']
}
Input
import React from 'react'
import Button from 'button'
import _ from 'lodash'
import moment from 'moment'
import { data } from '../some-where'
// ...
const a = {}
a.moment = <Button x={data} />
Output
import React from 'react'
import Button from 'button'
- import _ from 'lodash'
- import moment from 'moment'
import {data} from '../some-where'
// ...
const a = {}
a.moment = <Button x={data} />
Todo
- [x] Supporting Scope