hilongjw / vue-ssr-hmr-template

Interesting! Vue2 + Webpack2 + HMR + Server Side Render + Express template see demo->
http://ssr.bood.in/
226 stars 41 forks source link

vue-ssr-hmr-template

a interesting Vue project template

Build Setup

# install dependencies
npm i
npm install supervisor -g

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# run app
npm start

Directory

Auto Webpack Entry

getEntries( webpackHotMiddlewareConfig, // String webpackHotMiddlewareConfig, exceptList, // Array except some dir in client isServer // Boolean )

const getEntries = require('./getEntries')
const webpackHotMiddlewareConfig = 'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000'

const developmentConf = merge(baseConfig, {
    ...

    entry: getEntries(webpackHotMiddlewareConfig, [], false)

    ...
})

Server Side Render

vue-ssr vue-server-renderer

License

The MIT License