1.1.0 • Published 1 year ago

mishang-cli v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

ms-cli 命令行工具

用于快速创建React页面与React组件的命令行工具。

  • 创建组件
  • 创建页面

Installation

npm install ms-cli

如何创建组件&页面

输入指令:

ms-cli

然后按需求选择创建内容,然后按要求输入组件或页面名称即可

create component create page

指定创建到当前命令行路径

ms-cli --cwd

如何自定义配置文件

在项目根目录中添加ms.config.json 文件,即可覆盖默认配置,注意如果配置了 templates 中组件或页面的路径,则必须在根目录中创建对应路径的模板文件

{
  "templates": {
    "component": { 
      "component": "./templates/component", // 基础组件的模板目录
      "businessComponent": "./templates/component" // 业务组件的目标目录
    },
    "page": {
      "page": "./templates/page" // 页面模板目录
    }
  },
  "output": { // 对应上方的模板生成后的输出目录
    "component": {
      "component": "./src/component",
      "businessComponent": "./src/pages/component"
    },
    "page": {
      "page": "./src/pages"
    }
  }
}
1.1.0

1 year ago

1.0.0

1 year ago