0.0.1 • Published 3 years ago

reg-t v0.0.1

Weekly downloads
48
License
MIT
Repository
github
Last release
3 years ago

reg-t

文件生成器

使用

项目根目录下创建 reg-t.config.jsreg-t.config.json 配置文件

{
  "template": {
    "default": {
      "path": "templates",
      "output": "src/component"
    }
  }
}

创建模板文件 templates/__name__.js

import React from 'react'

const __name__ = () => <h1>__name__ template</h1>

使用cli

npx reg-t MyInput

会在 src/component 下创建 MyInput/MyInput.js文件

import React from 'react'

const MyInput = () => <h1>MyInput template</h1>