babel-plugin-bend-component
v0.0.17
Published
babel-plugin for meituan b end
Downloads
36
Readme
babel-plugin-bend-component
Install
npm i babel-plugin-bend-component -D
Example
** production **
Converts
import { bdSelector } from '@hfe/bend-component'
to
const bdSelector = require('@hfe/bend-component/lib/bdSelector/index.js')
require('@hfe/bend-component/lib/bdSelector/style.css')
** development **
Converts
import { bdSelector } from '@hfe/bend-component'
to
const bdSelector = require('@hfe/bend-component/components/bdSelector/index.js')
** debug **
Converts
import { bdSelector } from '@hfe/bend-component'
to
const bdSelector = require('@hfe/bend-component/dist/bdSelector/index.js')
require('@hfe/bend-component/dist/bdSelector/style.css')
Usage
Via .babelrc
or babel-loader.
// .babelrc
{
"plugins": [
[
"bend-component",
{
"libraryName": "@hfe/bend-component",
"devDir": "components",
"libDir": "lib",
"distDir": 'dist'
}
]
]
}
Environment Variables
提供BEND_ENV
变量控制
production
FOR ${libDir}
default TO lib
development
FOR ${devDir}
default TO components
debug
FOR ${distDir}
default TO dist
license
MTA