From 31ca1b72a7198d360a9f09094316218ab1c8c193 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 5 Jan 2021 16:40:52 +0200 Subject: [PATCH 1/2] Delete assets from resources path --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 160bd9d..9651d05 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,8 @@ Besides the above, no configuration's required. If you need to tweak things anyw You'll need to build two scripts: a server script and a client script. Refer to your frontend-framework-of-choice's documentation on how to build those. ```js -mix.js('resources/assets/js/app-client.js', 'public/js') - .js('resources/assets/js/app-server.js', 'public/js'); +mix.js('resources/js/app-client.js', 'public/js') + .js('resources/js/app-server.js', 'public/js'); ``` The server script should be passed to the `ssr` function, the client script should be loaded manually. The package assumes you're using Laravel Mix, and will resolve the path for you. You can opt out of this behaviour by setting `mix` to `false` in the config file. @@ -85,7 +85,7 @@ The server script should be passed to the `ssr` function, the client script shou Your server script should call a `dispatch` function to send the rendered html back to the view. Here's a quick example of a set of Vue scripts for a server-rendered app. Read the [spatie/server-side-rendering](https://github.com/spatie/server-side-rendering#core-concepts) readme for a full explanation of how everything's tied together. ```js -// resources/assets/js/app.js +// resources/js/app.js import Vue from 'vue'; import App from './components/App'; @@ -96,7 +96,7 @@ export default new Vue({ ``` ```js -// resources/assets/js/app-client.js +// resources/js/app-client.js import app from './app'; @@ -104,7 +104,7 @@ app.$mount('#app'); ``` ```js -// resources/assets/js/app-server.js +// resources/js/app-server.js import app from './app'; import renderVueComponentToString from 'vue-server-renderer/basic'; From cbaab4c2fe7df29f324408ce9a73ae846bdaf71c Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 5 Jan 2021 16:52:56 +0200 Subject: [PATCH 2/2] Correct client app script --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9651d05..d921a03 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ The package exposes an `ssr` helper to render your app. My server side rendered app - {!! ssr('js/app-server.js')->render() !!} @@ -140,7 +140,7 @@ A facade is available too. My server side rendered app - {!! Ssr::entry('js/app-server.js')->render() !!} @@ -154,7 +154,7 @@ Rendering options can be chained after the function or facade call. My server side rendered app - {!! ssr('js/app-server.js')->context('user', $user)->render() !!}