0.0.2 • Published 1 year ago

@supermapgis/babel-plugin-import v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@supermapgis/babel-plugin-import

babel的模块化导入插件, 兼容 @supermapgis/iclient-leaflet, @supermapgis/iclient-mapboxgl, @supermapgis/iclient-ol.

{ "libraryName": "@supermapgis/iclient-leaflet" }

import { Logo } from '@supermapgis/iclient-leaflet';
new Logo();

      ↓ ↓ ↓ ↓ ↓ ↓

var Logo = require('@supermapgis/iclient-leaflet/control/Logo.js').Logo;
new Logo();

Usage

@supermapgis/iclient-leaflet为例

npm install @supermapgis/babel-plugin-import --save-dev

Via .babelrc or babel-loader.

{
  "plugins": [
    ['@supermapgis/babel-plugin-import', { libraryName: '@supermapgis/iclient-leaflet' }]
  ]
}

更多

0.0.2

1 year ago