Skip to content

Yuanbin-xavier/vue-pages-workflow

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue Pages Workflow

Status: Prototype stage.

Notice: if this template updates, you have to do manual updates!

Gulp rendered multi-pages demo in Vue.

Demo http://vue-pages-workflow.mvc-works.org/

Try "view source" and "refresh page" to confirm is already rendered.

Goals

Build paths in router into pages, and server pages with Nginx. For several benefits:

  • pages look like server-rendered
  • performant with Nginx static server
  • requests sent from browsers, less tricky required

Ideas explained:

Develop

Using Vue 2 to render Vue app in Node.js or more specificly Gulp.

Using Webpack 2 since Vue 2 write docs in it.

  • run in dev mode

To start app in development environment:

make dev
# load build/index.html in a browser, Nginx suggested
  • run in build mode

To build the app:

make build
# see build/ for compiled files
# load build/index.html in a browser, make sure the path is `/`
  • add pages

To add pages, you have to make sure it works on both scenarios.

  • For client routing, add new router in src/router.js with a component.
  • For routing on Nginx, add the path to configs/pages-list.js to generate an HTML file.

Make sure the names are consistent and ends with .html, so that Nginx will resolve the file correctly and vue-router also will recognize.

License

MIT

About

Prototype workflow for multi-pages gulp-rendered apps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 82.0%
  • Vue 11.2%
  • Makefile 3.8%
  • HTML 2.4%
  • CSS 0.6%