babel-plugin-import-proxy
v0.0.2
Published
a babel plugin for 'import' syntax proxy
Downloads
3
Readme
babel-plugin-import-proxy
a babel plugin for 'import' syntax proxy
Function
import {Button, Table} from 'packageName';
transform to
import Button from 'packageName/lib/Button';
import Table from 'packageName/lib/Table';
import {Button, Table} from 'packageName';
transform to
import Button from 'packageName/lib/Button';
import Button from 'packageName/lib/Button/style.less';
import Table from 'packageName/lib/Table';
import Table from 'packageName/lib/Table/style.less';
etc.
Usage
in a babel'config file, e.g. .babelrc
"plugins": [
[
"import-proxy",
{
from: "packageName",
to: "packageName/lib/${name}",
// style: "packageName/lib/${name}/style.less", // default undefined not required
// useCamelCase: true, // default: false not required
}
]
]