@antm-business/ui
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

使用指南

文档地址

介绍

antm-business是一款基于taro和antmjs构建的业务组件库

使用antmjs和antm-business

  1. 安装
# 通过 npm 安装
npm install @antmjs/vantui
npm install @antm-business/ui

# 通过 yarn 安装
yarn add @antmjs/vantui
yarn add @antm-business/ui
  1. 默认node_modules内的模块不会被编译,需要配置
const config = {
  h5: {
    esnextModules: ["@antmjs", "@antm-business"],
    postcss: {
      autoprefixer: {
        enable: true,
        config: {
        }
      },
      pxtransform: {
        enable: true,
        config: {},
      },
      cssModules: {
        enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
        config: {
          namingPattern: 'module', // 转换模式,取值为 global/module
          generateScopedName: '[name]__[local]___[hash:base64:5]'
        }
      }
    }
  }
}

配置按需加载

  1. 下载插件
npm i babel-plugin-import -D
  1. 配置
module.exports = {
  presets: [
    ['taro', {
      framework: 'react',
      ts: true
    }]
  ],
  plugins: [
    [
      "import",
      {
        "libraryName": "@antmjs/vantui",
        "libraryDirectory": "es",
        "style": (name) => `${name}/style/less`,
      },
      "@antmjs/vantui"
    ],
    [
      "import",
      {
        "libraryName": "@antm-business/ui",
        "libraryDirectory": "dist/esm/packages",
        "style": (name) => `${name}/style`,
      },
      "@antm-business/ui"
    ]
  ]
}

Readme

Keywords

Package Sidebar

Install

npm i @antm-business/ui

Weekly Downloads

2

Version

0.0.5

License

ISC

Unpacked Size

25.3 kB

Total Files

54

Last publish

Collaborators

  • april_ending