Skip to content

如何在umi中按需加载使用zarm组件库

JeromeLin edited this page Dec 17, 2020 · 2 revisions

安装依赖

yarn add babel-plugin-import --dev
yarn add zarm

umi的配置文件中加入babel插件的设置

// .umirc.js
export default {
  extraBabelPlugins: [
    ['import', { libraryName: 'zarm', libraryDirectory: 'es', style: 'css' }, 'zarm'],
  ]
};