@lexiang/babel-plugin-import
v0.3.0
Published
Component modular import plugin for babel.
Downloads
7,481
Readme
Introduction
lazy load component, base on babel-plugin-import
Example
basic usage
plugins: [
[
'@lexiang/babel-plugin-import',
{
libraryName: '@lexiang/venom',
componetDirectoryPrefix: 'venom-',
},
],
]
lazy load component
import { venomButton } from '@lexiang/venom';
↓ ↓ ↓ ↓ ↓ ↓
var button = require('@lexiang/venom/lib/button');
require('@lexiang/venom/lib/button/index.csss');
multi usage
plugins: [
[
'@lexiang/babel-plugin-import',
{
libraryName: '@lexiang/venom',
componetDirectoryPrefix: 'venom-',
},
'@lexiang/venom',
],
[
'@lexiang/babel-plugin-import',
{
libraryName: '@lexiang/nova',
componetDirectoryPrefix: 'nova-',
},
'@lexiang/nova',
],
],
see more configs at babel-plugin-import