StackBlitz is a WebIDE that allows you to create e-commerce sites in your browser using SAP Spartacus.
The brief steps are as follows:
Add Spartacus dependencies manually in package.json. Here is the default Angular dependency generated by StackBlitz before adding the Angular app:
Below is the complete dependency, the source code attached for your reference:
{
"name": "mystore"."version": "0.0.0"."scripts": {
"ng": "ng"."start": "ng serve"."build": "ng build"."test": "ng test"."lint": "ng lint"."e2e": "ng e2e"
},
"private": true."dependencies": {
"@angular/animations": "~ 9.1.12"."@angular/common": "~ 9.1.12"."@angular/compiler": "~ 9.1.12"."@angular/core": "~ 9.1.12"."@angular/forms": "~ 9.1.12"."@angular/localize": "~ 9.1.12"."@angular/platform-browser": "~ 9.1.12"."@angular/platform-browser-dynamic": "~ 9.1.12"."@angular/router": "~ 9.1.12"."@angular/service-worker": "~ 9.1.12"."@ng-bootstrap/ng-bootstrap": "^ 6.0.0"."@ng-select/ng-select": "^ 4.0.0"."@ngrx/effects": "~ 9.1.0"."@ngrx/router-store": "~ 9.1.0"."@ngrx/store": "~ 9.1.0"."@spartacus/assets": "^ 2.1.0." "."@spartacus/core": "^ 2.1.0." "."@spartacus/storefront": "^ 2.1.0." "."@spartacus/styles": "^ 2.1.0." "."bootstrap": "2"."i18next": "^ 19.3.4"."i18next-xhr-backend": "^ 3.2.2." "."ngx-infinite-scroll": "^ 8.0.0." "."rxjs": "~ 6.5.4"."tslib": "^ 1.10.0"."zone.js": "~ 0.10.2." "
},
"devDependencies": {
"@angular-devkit/build-angular": "~ 0.901.12"."@angular/cli": "~ 9.1.12"."@angular/compiler-cli": "~ 9.1.12"."@spartacus/schematics": "^ 2.1.0." "."@types/jasmine": "~ 3.5.0." "."@types/jasminewd2": "~ 2.0.3"."@types/node": "^ 12.11.1." "."codelyzer": "^ 5.1.2." "."jasmine-core": "~ 3.5.0." "."jasmine-spec-reporter": "~ 2"."karma": "~ 5.0.0"."karma-chrome-launcher": "~ 3.1.0"."karma-coverage-istanbul-reporter": "~ 2.1.0." "."karma-jasmine": "~ 3.0.1." "."karma-jasmine-html-reporter": "^ 1.4.2." "."protractor": "~ 7.0.0." "."ts-node": "~ 8.3.0"."tslint": "~ 6.1.0"."typescript": "~ 3.8.3"}}Copy the code
After the dependencies are installed, you can view the generated Spartacus foreground page in StackBlitz’s preview window:
For more of Jerry’s original articles, please follow the public account “Wang Zixi “: