babel-plugin-comby-import

1.0.2 • Public • Published

babel-plugin-comby-import

基于babel-plugin-import 1.4.0,增加支持主题库配置


Usage

npm install babel-plugin-comby-import --save-dev

Via .babelrc or babel-loader.

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

options

options can be object.

{
  "libraryName": "antd",
  "style": true,   // or 'css'
}
{
  "libraryName": "comby-lib-mobile",
  "libraryDirectory": "components",  // default: lib
  "camel2DashComponentName": false,  // default: true
  "styleLibraryName": "comby-lib-mobile-theme",
  "styleDirectory": "src", //default: dist
}
{
  "libraryName": "comby-lib-mobile",
  "styleLibraryPath": "/code/comby-lib-mobile/theme/src"
}

options can be an array.

For Example:

[
  {
    "libraryName": "antd",
    "libraryDirectory": "lib",   // default: lib
    "style": true
  },
  {
    "libraryName": "antd-mobile"
  },
]

style

  • ["import", { "libraryName": "antd" }]: import js modularly
  • ["import", { "libraryName": "antd", "style": true }]: import js and css modularly (LESS/Sass source files)
  • ["import", { "libraryName": "antd", "style": "css" }]: import js and css modularly (css built files)

Package Sidebar

Install

npm i babel-plugin-comby-import

Weekly Downloads

6

Version

1.0.2

License

MIT

Unpacked Size

16.3 kB

Total Files

4

Last publish

Collaborators

  • perfey7891