babel-plugin-reduce-import
v0.1.2
Published
This plugin is used to import on demand.
Downloads
6
Readme
babel-plugin-reduce-import
This plugin is used to import on demand.
Install
npm install -D babel-plugin-reduce-import
Usage
{
presets: []
plugins: [
['babel-plugin-reduce-import', {
library: 'antd',
directory: 'lib', // default to 'lib'
namingRule: 'dash', // 'little-camel', 'big-camel', 'dash', 'underline', function, default to 'big-camel'.
importDefault: false, // default to true.
style: { // true or object, default to null.
directory: 'style', // 'style' or '/less/component', default to upper directory.
namingRule: 'index', // 'little-camel', 'big-camel', 'dash', 'underline', string, function, default to null.
ext: 'css' // js, css, less, sass, default to null.
}
}]
]
}
Use for antd.
Use for material-ui.
Use for elementalui
Options
{
library,
directory,
namingRule,
style: {
directory,
namingRule,
extension
}
}
library
string, default to null.
Set library name.
directory
string, default to 'lib'.
Set component directory.
namingRule
'little-camel', 'big-camel', 'dash', 'underline' or function, default to 'big-camel'.
importDefault
boolean, default to true. Transform import type to default.
style
boolean or object, default to false. import related style file and set import mode with style.
directory
string, default to component directory. Set style directory.
namingRule
'little-camel', 'big-camel', 'dash', 'underline', custom string or function, default to null.
extension
string, default to null. style file extension, example 'css', 'less', 'sass' or 'js'.