https://github.com/followmetech/babel-plugin-replace-import-path
替换 import path 的值
https://github.com/followmetech/babel-plugin-replace-import-path
babel-plugin import-path replace
Last synced: over 1 year ago
JSON representation
替换 import path 的值
- Host: GitHub
- URL: https://github.com/followmetech/babel-plugin-replace-import-path
- Owner: FollowmeTech
- License: mit
- Created: 2018-04-11T09:12:32.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-07-07T17:42:38.000Z (almost 6 years ago)
- Last Synced: 2024-04-26T16:06:27.820Z (about 2 years ago)
- Topics: babel-plugin, import-path, replace
- Language: JavaScript
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/dwqs/babel-plugin-replace-import-path?branch=master) [](http://standardjs.com)  
# babel-plugin-replace-import-path
替换 import path 的值
## Installation
Install the pkg with npm:
```
npm i babel-plugin-replace-import-path -D
```
or yarn
```
yarn add babel-plugin-replace-import-path -D
```
## Usage
Via `.babelrc` or babel-loader.
```
{
"plugins": [["replace-import-path", options]]
}
```
### options
`options` can be object.
```
{
src: 'test',
dest: 'lib'
}
```
`options` can be an array.
```
[
{
src: 'test1',
dest: 'lib1'
},
{
src: 'test2',
dest: 'lib2'
}
]
```
## Example
**{ "src": "test1/aaa", dest: "test2/bbb" }**
```js
import { A } from 'test1/aaa';
↓ ↓ ↓ ↓ ↓ ↓
var a = require('test2/bbb');
```
## LICENSE
MIT