1.0.3 • Published 6 years ago

mit-wx-scaffold v1.0.3

Weekly downloads
4
License
MIT
Repository
-
Last release
6 years ago

功能

  • 根据page模板生成page
  • 根据component模板生成component
  • 支持自定义模板

安装

$ npm i -g mit-wx-scaffold

用法

查看帮助

$ wx-scaffold --help

创建页面

示例一(使用yes模式)

$ wx-scaffold create --name test --yes

示例二(不使用yes模式)

$ wx-scaffold create --name test
#回答问题
#自动生成...

参数

  • dir: app.json文件所在路径
  • name: page的名称,支持带相对/绝对路径(/path/my-page, path/my-page, your/path/, my-page)
  • type: 创建的页面类型,page,component可选,默认page
  • style: 样式文件后缀名,支持 less, scss, wxss 或自定义
  • json: 是否需要生成配置文件
  • yes: 使用默认值生成相关文件
  • help: 查看帮助

重置模板

$ wx-scaffold reset

查看模板位置

$ wx-scaffold dir

打开模板目录

$ wx-scaffold open

自定义模版

  1. 通过 wx-scaffold open 命令打开模版目录
  2. 编辑并替换默认模版
  3. 完成

Tips 若需要重置使用默认模版,可以执行 wx-scaffold reset 命令