天天看點

如何使用schematics快速建立全新的SAP Spartacus Storefront并啟用SSR

SSR 測試要點

I checked once again version 2.1.0 of spartacus. Everything works correctly in spartacus instance (without customizations) with SSR (with PWA and without, with lazy loaded translations and with static translations).

ng add @spartacus/schematics --baseUrl

https://spartacus-dev4.eastus.cloudapp.azure.com:9002/

--baseSite=electronics-spa --ssr

不能在空檔案夾裡使用上述指令行:

如何使用schematics快速建立全新的SAP Spartacus Storefront并啟用SSR
如何使用schematics快速建立全新的SAP Spartacus Storefront并啟用SSR
如何使用schematics快速建立全新的SAP Spartacus Storefront并啟用SSR

然後再執行指令行:

https://spartacus-demo.eastus.cloudapp.azure.com:8443/
如何使用schematics快速建立全新的SAP Spartacus Storefront并啟用SSR

執行

npm run build:ssr

對應的腳本是:ng build --prod && ng run standalone:server:production

如何使用schematics快速建立全新的SAP Spartacus Storefront并啟用SSR

然後執行npm run serve:ssr

對應的腳本是:

node dist/standalone/server/main.js

如何使用schematics快速建立全新的SAP Spartacus Storefront并啟用SSR
如何使用schematics快速建立全新的SAP Spartacus Storefront并啟用SSR

繼續閱讀