@supermapgis/babel-plugin-import
v0.0.2
Published
Component modular import plugin for babel.
Downloads
69
Readme
@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' }]
]
}