1.2.0 • Published 2 years ago
option2meta v1.2.0
描述
根据option.json生成对应的meta.js文件
安装依赖【开发】
pnpm i --registry=https://registry.npmjs.org版本要求
node >= 16.16.0
功能
输出包版本信息 -v --version
执行:
o2m -v
o2m --version输出帮助信息 -h --help
o2m -h
o2m --help配置编译 -b --build
o2m -b configPath
o2m --build configPath注意,这里接收参数configPath,它是一个绝对文件路径,比如:
o2m --build ./test/configs/.o2m.config.json处理json文件,还支持js文件:
o2m --build ./test/configs/.o2m.config.js配置
下面说一下文件配置,以js文件为例:
module.exports = {
//是否格式化
"format": false,
//配置路径
"optionPath": "../options/option.js", //支持.js .json .xlsx .xls
//meta.ts文件生成路径
"metaPath": "../metas/meta.ts",
//模板文件路径
"templatePath": "../templates/template.ts",
//通过接口处理
"url": 'http://www.example.com/function/importmaterial',
//组件名称--可选,默认BizFormInput
"componentName":"TestComponent",
}下面依此说明每个配置的意义:
后续支持的功能
- 根据
excel文件生成配置 - 支持通过接口获取
json