babel-plugin-clean-dead-imports
TypeScript icon, indicating that this package has built-in type declarations

0.8.2 • Public • Published

babel-plugin-clean-dead-imports

清除无用导入的 Babel 插件。

例子

In

import A, { B, C } from './C';
 
export { B, /* type */ C };

Out

import { B } from './C';
 
export { B };

安装

yarn add babel-plugin-clean-dead-imports

使用

通过 .babelrc (推荐)

.babelrc

{
  "plugins": ["babel-plugin-clean-dead-imports"]
}

通过命令行

babel --plugins babel-plugin-clean-dead-imports script.js

通过 Node API

require('@babel/core').transform('code', {
  plugins: ['babel-plugin-clean-dead-imports'],
});

Readme

Keywords

none

Package Sidebar

Install

npm i babel-plugin-clean-dead-imports

Weekly Downloads

0

Version

0.8.2

License

MIT

Unpacked Size

11 kB

Total Files

9

Last publish

Collaborators

  • jackingliu