You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you decide to build a new reusable vue component, you probably want to see it in action in different environments without much effort.
What?
vue-dev-server is a small development server for building vue components. It takes different environments (own components) and makes them available in your browser, of course with hot reload functionality.
Usage: vue-dev-server [options]
Options:
-h, --help output usage information
-V, --version output the version number
-p, --port <number> port to use (default: 8080)
-f, --folder <path> root path (default: dev)
-s, --static <path> exports a static version
Setting up an environment
By default vue-dev-server will look in the dev folder for vue files.
Just create a someName.vue file there. Require your component from there normally.
All environments will then be accessible under https://localhost:8080/.
Example of project layout
./dev/env1.vue // links your component. Contains an environment to interact with your component.
./src/comp.vue // your component.
./comp.js // your component compiled down to ES5 (for examply by `vue-compiler`).
If you need more examples check out vue-comps. I'm using vue-dev-server for all my components.
Using static option to create a demo for github pages
in conjuction with gh-pages, creating a demo is as simple as this: