【文件属性】:
文件名称:babel-plugin-on-demand-import:Babel插件,用于按需导入组件
文件大小:8KB
文件格式:ZIP
更新时间:2021-01-30 00:20:53
babel babel-plugin import on-demand BabelJavaScript
Babel插件按需导入
Babel插件,用于按需导入组件。
安装
使用npm安装pkg:
npm i babel-plugin-on-demand-import -D
或纱线
yarn add babel-plugin-on-demand-import -D
用法
通过.babelrc或babel-loader。
{
"plugins": [["on-demand-import", options]]
}
选项
options可以是对象。
{
libraryName: 'test',
libraryPath: 'lib', // default: lib
stylePath: 'your-style-path', // defalut: undefined
needImportStyle: true // default: false
}
options可以是数组。
[
{
libraryName: 'test1'
},
{
libraryName: 'test2'
【文件预览】:
babel-plugin-on-demand-import-master
----.travis.yml(150B)
----.eslintrc(599B)
----package.json(2KB)
----test()
--------index.js(2KB)
--------array-code.js(60B)
--------array-code-test-result.js(209B)
----LICENSE(1KB)
----src()
--------index.js(2KB)
----.gitignore(46B)
----lib()
--------index.js(2KB)
----README.md(2KB)
----.eslintignore(8B)