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
不能在空文件夹里使用上述命令行:
然后再执行命令行:
ng add @spartacus/schematics --baseUrl https://spartacus-demo.eastus.cloudapp.azure.com:8443/ --baseSite=electronics-spa --ssr
执行
npm run build:ssr
对应的脚本是:ng build --prod && ng run standalone:server:production
然后执行npm run serve:ssr
对应的脚本是:
node dist/standalone/server/main.js