E-Com Plus Storefront Router
SPA/SSR router for E-Com Plus storefront
@ecomplus/storefront-router package may be used for:
- List all products, brands, categories and collections pages (URL paths) for prerenderization/SSR;
- Based on URL path, get document body (product, brand, category, collection) on browser or server side to render the page markup;
It's available for both Node.js and browser environments.
const router =// Simple example resolving all routesrouter
It may require and doesn't include
core-js (optional) and
@ecomplus/utils (peer dependency).
npm i --save core-js @ecomplus/utils @ecomplus/storefront-router
npm i --save @ecomplus/utils @ecomplus/storefront-router
When importing from CDN,
ecomClient libraries must be included separately and available on window scope.