From 72ae8d51b1f6c7afe1e0cba2c90a92e46e5fd57c Mon Sep 17 00:00:00 2001 From: Willy Brauner Date: Thu, 17 Nov 2022 15:41:16 +0100 Subject: [PATCH] Externalize prepare template --- docs/02.vite-configuration.md | 2 +- docs/03.vite-simple-spa-installation.md | 2 +- docs/09.php-service-integration.md | 2 +- index.html | 2 +- package.json | 4 +- prerender/prerender.ts | 19 +++----- server/prepareTemplate.js | 21 +++++++++ server.js => server/server.js | 61 ++++++++++++------------- src/{index.tsx => index-client.tsx} | 0 vite.scripts.config.ts | 2 +- 10 files changed, 65 insertions(+), 50 deletions(-) create mode 100644 server/prepareTemplate.js rename server.js => server/server.js (67%) rename src/{index.tsx => index-client.tsx} (100%) diff --git a/docs/02.vite-configuration.md b/docs/02.vite-configuration.md index 7ca8806..65ab7bf 100644 --- a/docs/02.vite-configuration.md +++ b/docs/02.vite-configuration.md @@ -12,7 +12,7 @@ Vite's configuration is managed by two main files: ### Entry points -By default, the single application entrypoint is [src/index.tsx](src/index.tsx). It initializes a react App. +By default, the single application entrypoint is [src/index.tsx](src/index-client.tsx). It initializes a react App. But this file can be changed as `index.ts` or `index.js`. In case this filename or type change, [config/config.js](config/config.js) `input` array need to be modified. diff --git a/docs/03.vite-simple-spa-installation.md b/docs/03.vite-simple-spa-installation.md index 3f10df1..614abe9 100644 --- a/docs/03.vite-simple-spa-installation.md +++ b/docs/03.vite-simple-spa-installation.md @@ -15,7 +15,7 @@ In order to always keep the same folder structure, this config generates statics
- + ``` diff --git a/docs/09.php-service-integration.md b/docs/09.php-service-integration.md index 6efba3b..fa94c74 100644 --- a/docs/09.php-service-integration.md +++ b/docs/09.php-service-integration.md @@ -4,7 +4,7 @@ - Add `./composer-install.sh` script in the project root. - Add docker apache volume in `docker-compose.yml` - Remove ssr ssg files - - [server.js](../server.js) + - [server.js](../server/server.js) - [vite.scripts.config.js](../vite.scripts.config.js) - [index.html](index.html) - Update [config/config.js](../config/config.js) diff --git a/index.html b/index.html index 0b908ae..bc3fd81 100644 --- a/index.html +++ b/index.html @@ -27,7 +27,7 @@
- +