From ce10c323df97c168da43695dae88b1b5b54cef5c Mon Sep 17 00:00:00 2001 From: zhangzhuang15 <2592004894@qq.com> Date: Wed, 23 Aug 2023 15:14:20 +0800 Subject: [PATCH] fix #7, which contains 2 div element with same id; make the name of file more impressive; add activation of client side in ssr; add compiler config of client side in ssr; --- package.json | 4 +- src/{main.server.js => App.js} | 0 src/App.vue | 4 +- src/server.js | 9 ++++- src/{main.js => spa-client.js} | 0 src/ssr-client.js | 5 +++ vue.config.js | 70 ++++++++++++++++++++++++++++++---- 7 files changed, 80 insertions(+), 12 deletions(-) rename src/{main.server.js => App.js} (100%) rename src/{main.js => spa-client.js} (100%) create mode 100644 src/ssr-client.js diff --git a/package.json b/package.json index da4efb1..5080ead 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,9 @@ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", - "pressr": "cross-env SSR=true vue-cli-service build", + "pressr-client": "cross-env SSR=true CLIENT=true vue-cli-service build", + "pressr-server": "cross-env SSR=true vue-cli-service build", + "pressr": "pnpm run pressr-server && pnpm run pressr-client", "ssr": "node src/server.js", "lint": "vue-cli-service lint" }, diff --git a/src/main.server.js b/src/App.js similarity index 100% rename from src/main.server.js rename to src/App.js diff --git a/src/App.vue b/src/App.vue index 55df315..8793d47 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,5 @@