Closed codeitlikemiley closed 6 years ago
ive got it working , only the rendere.js has cause me this error before i got this
const bundlePath = path.resolve(__dirname, '../vue-ssr-bundle.json')
now
if (!isDev) {
const bundlePath = path.join(this.webpackServerConfig.output.path, getFileName(this.webpackServerConfig, this.projectName))
//! Using https://ssr.vuejs.org/en/build-config.html
this.renderer = this.createRenderer(fs.readFileSync(bundlePath, 'utf-8'))
and for the record i remove this in
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
minChunks: Infinity
}),
webpack.mix.json coz its giving an error of
main.js:1 Uncaught ReferenceError: webpackJsonp is not defined
at main.js:1
it seems to me that we dont need this part since we are using laravel mix manifest ...
i have critical css inject as a result :)
i see there is an unassigned var webpack.server.js
which is used in vue ssr at this link
ive havent have luck using on it coz even though everything is ok when i run yarn prod and yarn run:server
this gives me error as such
Anyway have configure the following files views.js renderer.js webpack.server.js and webpack.mix.js
and for the record im using latest laravel 5.5 vue, vuex , vue router,vue-server-renderer
Here is my Code: view.js
renderer.js
webpack.server.js
webpack.mix.js
it did produce me vue-ssr-bundle.json main.build.js and vue-ssr-client.manifest.json
Without node run:server running, if it is not running i get![image](https://user-images.githubusercontent.com/28816690/35023197-98951a04-fb74-11e7-9b0b-18e6886fb26c.png)
If i do run node run:server i get this