https://sap.github.io/spartacus-docs/schematics/
SAP Spartacus Schematics提供了一个向导,能够帮助您将Spartacus libraries安装到自己的Angular项目中。
Schematics提供了命令行的使用方式:
ng add @spartacus/schematics
命令行提供的各种参数:
baseUrl sets the base URL of your CX OCC back end.
baseSite is a comma-separated list of base site(s) to use with Spartacus.
currency is a comma-separated list of currencies to use in Spartacus.
language is a comma-separated list of languages to use in Spartacus.
occPrefix sets the OCC API prefix, such as /occ/v2/, for example.
useMetaTags determines whether or not to configure the baseUrl and mediaUrl in the meta tags from index.html.
featureLevel sets the application feature level. The default value is 2.0.
overwriteAppComponent overwrites the content of app.component.html. The default value is true.
pwa includes progressive web application (PWA) features when building the application.
ssr includes the server-side rendering (SSR) configuration.
一个例子:
ng add @spartacus/schematics --baseUrl https://spartacus-demo.eastus.cloudapp.azure.com:8443/ --baseSite=electronics-spa --ssr
通过schematics安装指定版本
ng add @spartacus/schematics@2.1.0