1.0.2 • Published 2 years ago
babel-transform-import-plugin v1.0.2
babel-transform-import-plugin
babel插件用于修改引用包名
Install
yarn add -D babel-transform-import-plugin
or
npm i babel-transform-import-plugin --save-dev
案例
{
"plugins": [
["babel-transform-import-plugin", {
// 要替换的包名
"libraryName": "@uiw/react-native",
// 转换的包名
"alias": "@uiw/react-native/lib"
}]
]
}
将
import {Button, Spacing} from '@uiw/react-native';
转换成
import Button from "@uiw/react-native/lib/Button";
import Spacing from "@uiw/react-native/lib/Spacing";