Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

babel-plugin-import-slim

0.0.3 • Public • Published

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';

Install

npm i babel-plugin-import-slim

DownloadsWeekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

123 kB

Total Files

9

Last publish

Collaborators

  • avatar