typevue

1.0.7 • Public • Published

TypeVUE

Convert *.vue file from JavaScript object to TypeScript class;

Use

$ yarn global add typevue
# or
$ npm i -g typevue
$ typevue -d <input_path> -o <output_path> -c <config_file>

Config file format

Config file should be a json file or a js with module.exports = { ... };

// config schema
{
    "cssType": "css",
    "jsPathReg": "mixin",
    "importMap": {
        "ListMixin": {
            "oldPathReg": "@/common(/index)?",
            "newPath": "rds-vue"
        },
        "SelectMixin": {
            "oldPathReg": "@/common(/index)?",
            "newPath": "rds-vue"
        },
        "SomeModule": {
            "oldPath": "~/global",
            "newPath": "global-path"
        }
    }
}

cssType is used to specify the css language, default is css;

jsPathReg is used to set which path the js file will be transform;

importMap is used to change moudules import path, the oldPath property has high priority then oldPathReg;

TODO

  • provide/inject support;
  • replace substring;
  • generate code from AST;

Readme

Keywords

none

Package Sidebar

Install

npm i typevue

Weekly Downloads

2

Version

1.0.7

License

ISC

Unpacked Size

161 kB

Total Files

34

Last publish

Collaborators

  • lzxhahaha