babel-plugin-import-simple

babel插件 简易按需加载

Usage no npm install needed!

<script type="module">
  import babelPluginImportSimple from 'https://cdn.skypack.dev/babel-plugin-import-simple';
</script>

README

babel-plugin-import-simple

babel 按需加载插件 简易版

Install

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

babelrc 配置

{
  "plugins": [["import-simple", options]]
}

options

{
  "libraryName": "xxx", // 包名
  "libraryDirectory": "lib", // 仓库名
  "toUnderlineLowerCase": true // 转中划线小写
}