Vue.js - Prerender插件

时间:2017-07-09 23:06:23

标签: vue.js prerender

我想使用此plugin。要预呈现我的一些<= 200组件。

我的项目结构是<=

vue.js

我的组件位于Laravel 5.4

我在├── app ├── artisan ├── bootstrap ├── resources ├── assets js   app.js bootstrap.js components webpackconfig.js 中添加了此内容,尝试渲染与components路由关联的组件。

webpackconfig.js

问题

生成的文件index.html包含/

问题

我应该怎样做才能预渲染我的组件?

2 个答案:

答案 0 :(得分:1)

按照文档示例进行操作。您使用了错误的路径,请使用../dist代替./dist

new PrerenderSpaPlugin(
    // Path to compiled app
    path.join(__dirname, '../dist'),
    // List of endpoints you wish to prerender
   [ '/' ]
)

https://vuejs-templates.github.io/webpack/prerender.html

答案 1 :(得分:0)

您应该定位index.html入口点的正确路径 您目前正在定位dist文件夹。