搭建dev环境

更改package.json

vue ssr渲染(3)

 更改dev.js,先创建一个html放到webpack输出目录下,

vue ssr渲染(3)

npm run dev,浏览器打开http://localhost:8080,就可正常访问了, 

控制台输出 :main.js:1 hello 我是app

解决index.html的问题,html-webpack-plugin

npm i html-webpack-plugin -D

vue ssr渲染(3)

更改index.html文件,因为html-webpack-plugin开启了inject

vue ssr渲染(3)

下一章,集成vue 

相关文章: