0.0.3 • Published 5 years ago

babel-plugin-import-slim v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

babel-plugin-import-slim

Usage

yarn add babel-plugin-import-slim --dev

Via .babelrc or babel-loader.

{
  "plugins": [["import-slim", options]]
}

options

options can be object.

{
  "libraryName": "bee-ui",
  "camel2DashComponentName": true,  // default: false
  "customSourceFunc": (name) => {
       // something
  }
}

or

{
  "libraryName": "bee-ui",
  "camel2UnderlineComponentName": true,  // default: false
  "customSourceFunc": (name) => {
        // something
   }
}

options can be array.

[
    {
      "libraryName": "bee-ui",
      "camel2UnderlineComponentName": true,
      "customSourceFunc": (name) => {
            // something
       }
    },
    {
      "libraryName": "moma-ui",
      "camel2UnderlineComponentName": true,
      "customSourceFunc": (name) => {
            // something
       }
    },
]

Example

From

import { Select as BeeSelect, Pagination, DatePicker } from '@dp/bee-ui';

To

import BeeSelect from '@dp/bee-ui/src/components/ui-base/select/select';
import Pagination from '@dp/bee-ui/src/components/ui-base/pagination/pagination';
import DatePicker from '@dp/bee-ui/src/components/ui-base/date-picker/date-picker';