Thanks to visit codestin.com
Credit goes to github.com

Skip to content

uni-helper/unh

Repository files navigation

banner


uni-helper 封装的uni命令

安装

pnpm i -D @uni-helper/unh

使用

📖 请阅读完整文档了解完整使用方法!

pnpm dev wx
// package.json
{
  "scripts": {
    "dev": "unh dev",
    "build": "unh build",
    "prepare": "unh prepare"
  }
}
// unh.config.ts
import { defineConfig } from '@uni-helper/unh'

export default defineConfig({
  platform: {
    // 默认平台
    default: 'h5',
    // 平台别名
    alias: {
      'h5': ['w', 'h'],
      'mp-weixin': ['wx'],
    },
  },
  hooks: {
    prepare() {
      console.log('install')
    },
    build(platform: string) {
      console.log('build:', platform)
    },
    dev(platform: string) {
      console.log('dev:', platform)
    },
  },
  autoGenerate: {
    pages: true,
  }
})