0.12.1 • Published 4 years ago

babel-plugin-clean-type-import-export v0.12.1

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

babel-plugin-clean-type-import-export

清除类型导入和导出的 Babel 插件。

例子

In

import A, { B, C, D, E } from './C';

export {
  A,
  /* type */
  B,
  // type
  C,
};

Out

import A, { D, E } from './C';

export { A };

安装

yarn add babel-plugin-clean-type-import-export

使用

通过 .babelrc (推荐)

.babelrc

{
  "plugins": ["babel-plugin-clean-type-import-export"]
}

通过命令行

babel --plugins babel-plugin-clean-type-import-export script.js

通过 Node API

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