babel-plugin-danger-remove-unused-import-taro

1.0.0 • Public • Published

babel-plugin-danger-remove-unused-import

To shrink the bundle javascript size 😄

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} />

ChangeLog

  • 1.0.9
    Fix <Comp.A/> Bug

Todo

  1. Supporting Scope

Package Sidebar

Install

npm i babel-plugin-danger-remove-unused-import-taro

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

11.3 kB

Total Files

8

Last publish

Collaborators

  • defaultlee