# vue-cli-template-dev-server

> development server for vue.js custom template projects

Latest version **1.0.1** (published 2019-06-17) · WTFPL license · 0 weekly downloads

## Install

```sh
npm install vue-cli-template-dev-server
pnpm add vue-cli-template-dev-server
yarn add vue-cli-template-dev-server
bun add vue-cli-template-dev-server
```

Provides the command `vue-cli-template-dev-server`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-06-17 |
| First published | 2019-05-24 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Eliran Malka |
| Maintainers | eliranmal |

## Links

- npm: https://www.npmjs.com/package/vue-cli-template-dev-server
- Repository: https://github.com/eliranmal/vue-cli-template-dev-server
- Homepage: https://github.com/eliranmal/vue-cli-template-dev-server#readme
- Issues: https://github.com/eliranmal/vue-cli-template-dev-server/issues
- npm.io page: https://npm.io/package/vue-cli-template-dev-server

## Recent versions

- 1.0.1 (latest) — 2019-06-17
- 1.0.0 — 2019-06-15
- 0.5.0 — 2019-06-15
- 0.4.0 — 2019-06-15
- 0.3.6 — 2019-05-28
- 0.3.5 — 2019-05-28
- 0.3.4 — 2019-05-28
- 0.3.3 — 2019-05-25
- 0.3.2 — 2019-05-25
- 0.3.1 — 2019-05-24
- 0.3.0 — 2019-05-24
- 0.2.1 — 2019-05-24
- 0.2.0 — 2019-05-24

## README

# vue-cli-template-dev-server

*development server for building vue-cli custom templates*

[![NPM][1]][2]

---

<p align="center">
  <img src="./resources/example-usage.gif" />
</p>


## overview

this package provides a simple, file-watching server to ease the development of [vue-cli custom templates][3].

once started, the server will listen to changes in the app template source files (under the `/template` directory).
when a change is detected, it will re-compile the template to an output directory, allowing live inspection of the 
generated vue.js application.

after the output project is generated, if it's an NPM project, the server will collect its dependencies with `npm i`,
and run `npm run dev` (you can customize which command will run instead of `dev`).


## setup

- install via NPM:
  
  ```sh
  npm i vue-cli-template-dev-server -D
  ```

- add these bits:
  
  *package.json <sup>\*</sup>*
  
  ```json5
  {
    "scripts": {
      "dev": "vue-cli-template-dev-server"
    },
  }
  ```
  
  *.gitignore*
  
  ```gitignore
  out/
  ```
  
<sup>*\* if you don't have a package.json file, run `npm init`.*</sup>


## usage

simply run the dev script:

```sh
npm run dev
```

the server script accepts two optional arguments. the first one is used for overriding the output directory path
(defaults to `out`), and the second for the output project name (`awesome-vue-app`, if not provided).

to use them, either directly run:

```sh
npm run dev -- 'dist/dev-server-out' 'my-app'
```

&hellip; or put them in the package scripts for good:

```json5
{
  "scripts": {
    "dev": "vue-cli-template-dev-server 'dist/dev-server-out' 'my-app'"
  },
}
```

you can also change which NPM script will run on startup (`dev` by default), by passing the
`TARGET_INIT_COMMAND` environment variable:

```sh
env TARGET_INIT_COMMAND='serve' npm run dev -- 'dist/dev-server-out' 'my-app'
```


## demo

check out the [*/example*][5] directory in this repository for an example usage with the most simple application.
it only contains what's required for the dev-server to work.

to see it in action:

- get a local clone:
  
  ```sh
  cd <workspace-path>
  #   ^ replace this with your local workspace directory
  git clone https://github.com/eliranmal/vue-cli-template-dev-server.git
  ```

- navigate to the demo, and ignite the engines:
  
  ```sh
  cd <workspace-path>/vue-cli-template-dev-server/example
  #   ^ you know the drill
  npm start
  ```

  this will install dependencies, and run the example app's dev server.  
  from now on, if you kill the server, you can run it again with:
  
  ```sh
  npm run dev
  ```

- open *./template/hello.md* and *./out/hello.md* in your editor.

- edit *./template/hello.md* and save your changes.

- see *./out/hello.md* change accordingly.


## CLI

use the `-h` flag to see the manual.





[1]: https://img.shields.io/npm/v/vue-cli-template-dev-server.svg?style=flat-square
[2]: https://www.npmjs.com/package/vue-cli-template-dev-server
[3]: https://github.com/vuejs/vue-cli/tree/master#custom-templates
[5]: example

---
_Source: https://npm.io/package/vue-cli-template-dev-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
