iFDit / babel-plugin-x-import

Modules are loaded as needed(for xbrick)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

babel-plugin-x-import

Modules are loaded as needed(for xbrick ui)

Install

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

Usage

// in webpack.config.js
// ...other config
{
  loader: 'babel-loader',
  options: {
    plugins: ['babel-plugin-x-import']
  }
}

Example

// before
import { Alert, AlertStyles } from 'xbrick'
↓↓↓↓↓
// after
import { Alert } from 'xbrick/lib/alert/Alert'
import { AlertStyles } from 'xbrick/lib/alert/Alert'

About

Modules are loaded as needed(for xbrick)


Languages

Language:JavaScript 100.0%