Open hfq-daipengyun opened 6 years ago
What does your dist directory look like?
The file is like this: It should be like this :(assetsPublicPath= '/', but I need ='/sub/')
The data is a AXIOS request
I'll have to take a closer look at this one. I'm not sure how I could configure prerender-spa-plugin
to respect assetsPublicPath without getting things messed up.
你这个问题有解决吗
没有,之后考虑到项目数据变动频繁,为保证SEO实时性,去用服务器渲染了...
------------------ 原始邮件 ------------------ 发件人: "liangjie"; 发送时间: 2018年5月14日(星期一) 下午3:23 收件人: "chrisvfritz/prerender-spa-plugin"; 抄送: "hfq-daipengyun"; "Author"; 主题: Re: [chrisvfritz/prerender-spa-plugin] When assetsPublicPath is set,the page is not rendered successfully. (#176)
你这个问题有解决吗
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
I also encountered the same problem. The reason is that the compiled and configured assetsPublicPath before static CDN will be wrong. There are two solutions:
@hfq-daipengyun Hi man did you find a solution for your problem ? I have the same issue
I haven't taken a look at this yet, but my guess is that it just needs to serve an extra static directory if assetsPublicPath
is set.
For I found another solution to publish in a subfolder, and have the prerenderer
In /build/index.js conf for build :
assetsRoot: '../dist', assetsSubDirectory: 'subdirectory/static', assetsPublicPath: '/subdirectory/'
In /build/webpack.prod.env.js
output.publicPath: '/'
and conf for the PrerenderSPAPlugin
staticDir: config.build.assetsRoot, indexPath: path.join(config.build.assetsRoot, 'index.html'), outputDir: path.join(config.build.assetsRoot, config.build.assetsPublicPath),
all prerendered website will be in '/dist/subdirectory/'
Vue project The value of assetsPublicPath is not '/', but '/sub/'. The page after run build is not rendered successfully, if assetsPublicPath: '/' can do it. But in my project, assetsPublicPath has to be set up. What should I do? ...