GithubHelp home page GithubHelp logo

wanghuipeng / prerender-website Goto Github PK

View Code? Open in Web Editor NEW

This project forked from neveryu/prerender-website

0.0 2.0 0.0 3.56 MB

:wave::wave::wave:基于vue的预渲染解决方案

Home Page: https://neveryu.github.io/vue-tour/

HTML 0.31% JavaScript 24.50% Vue 74.73% CSS 0.46%

prerender-website's Introduction

A beautiful website with tour

Vue.js 2.0 + vue-router Prerender SPA Example

Demonstrates usage of Vuejs 2.0 with Vue Router and Webpack 3. Build will generate 6 static routes at the following paths:

  • /
  • /home
  • /information
  • /ticket
  • /scenery
  • /about

Build

npm install
npm run build

Now check the new dist directory for your prerendered static files!

To view the rendered files, you can

npm run prod

Now visit the following routes in your browser (note the trailing slash):

Development

To edit the prerender-spa-plugin configuration, look for new PrerenderSPAPlugin in the plugins section of webpack.config.js.

If you're using a router or have more than one page to prerender, edit the routes array under that config object.

npm install
npm run dev

Tip

  • 1.1 在开发过程中(npm run dev),vue-router 请务必使用 history 模式。
  • 2.1 如果你的项目是部署在根目录下的话,那么你可以直接打包(npm run build) ,然后进行部署。
  • 2.2 如果你的项目要部署在子目录下的话,那么你可能要注意了,这个时候你的 vue-router 不应该使用 history 模式,与此同时,publicPath 也应修改为 ./

Note

在写这个项目的时候也记录了几个知识点:关于本项目中的知识点

prerender-website's People

Contributors

neveryu avatar

Watchers

James Cloos avatar Muslim avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.