1.0.5 • Published 6 years ago

auto-import-cli v1.0.5

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

auto-import-cli

import modules automagically based on your configuration

Usage

Install with npm

npm i auto-import-cli

You should then setup a configuration file: auto-import-cli.json

After that, you can run auto-import-cli on your project like this:

$ autoimport

Configuration

[
    {
        "extname": ".vue",
        "from": "example/pages",
        "to": "example/router/index.js",
        "template": "const moduleName = () => import(modulePath)",
        "ignored": [
            "example/pages/login.vue",
            "example/pages/overall/**"
        ]
    }
]

extname : the type of file that may be a module.

from : the directory which contains modules.

to : the file which uses modules.

template : the way importing modules. moduleName and modulePath will be replace when tool is working.

"import moduleName from modulePath"
"const moduleName = require(modulePath)"
"const moduleName = () => import(modulePath)"

ignored : the files that should be ignored, suport anymatch

The config option is an array. You can make many rules as you want.

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.0

6 years ago