babel-plugin-replace-import-path

0.5.0 • Public • Published

build pass js-standard-style npm-version license

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

import { A } from 'test1/aaa';

     

var a = require('test2/bbb');

LICENSE

MIT

Package Sidebar

Install

npm i babel-plugin-replace-import-path

Weekly Downloads

0

Version

0.5.0

License

MIT

Unpacked Size

5.02 kB

Total Files

4

Last publish

Collaborators

  • dwqs