0.4.5 • Published 9 months ago

vior-cli v0.4.5

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Vior-CLI

A simple CLI with SFC (i.e. Single-File Components) suppport for Vior.

Languages

Usage

Install

npm install vior-cli -g

Initialize

vior init your-project-name

Then Vior will create a SFC project template in the folder (./your-project-name) as well as install dependencies for you.

Structure

/your-project-name
 |-- /src                # your souce codes (SFC files with '.html' suffixes, or common '.js' files) be in
 |-- /node_modules       # node.js' dependencies
 |-- /dist               # compiled codes be in
 |-- _index.html         # the source of entry HTML file
 |-- index.html          # the compiled entry HTML file
 |-- package.json        # the NPM configure file

Compile

cd ./your-project-name
vior compile

Then Vior will compile the source code from ./src into ./dist folder.

Compiled files will be all .js files, you can import them in any files you need.

SFC Format

<template>
    <!-- Vior custom component's HTML part to be here, instead of using `html` option in JS part in common -->
    <custom-component></custom-component>
</template>

<script>
    // Vior will prepare import-map for you, so that you can import like this:
    import Vior from 'vior'
    import YourComponent from 'yourComponent'
    import yourPlugin from 'yourPlugin'
    /* be like:
       import Vior from './node_modules/vior/src/index.js'
       import YourComponent from './dist/yourComponent.js'
       import yourPlugin from './dist/yourPlugin.js' */
    
    export default {
        /* component's options */
        comps: {
            'custom-component': YourComponent
        },
        plugins: [
            { plugin: YourPlugin }
        ]
    }
</script>

Hot Updating

vior auto

Then Vior will watch your project files, and do compiling when the files change.

Examples

See vior-sfc-fun.

0.4.5

9 months ago

0.4.4

9 months ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.5

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago