babel-plugin-danger-remove-unused-imports
Fork from babel-plugin-danger-remove-unused-import
and babel-plugin-remove-unused-imports
, Support remove unused require
.
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