0.1.0 • Published 3 years ago
@castletech/pwa-module-product-type v0.1.0
PWA Studio Product Type Extension

Create new product types in your pwa-studio using extensibility targetables api.
Compatibility: pwa-studio v11, v12
1. Installation
yarn add @castletech/pwa-module-product-type2. Active module in your local-intercept
const {
  wrapProductTypeModule,
} = require("@castletech/pwa-module-product-type/targets");
wrapProductTypeModule({
  targets
});3. Create new pwa-studio module
Create a new pwa-studio scaffolding module and connect the targetable productType api of the pwa-module-product-type module.
Exemple:
targets.of('@castletech/pwa-module-product-type').productType.tap(types =>
  types.add({
    condition: "product.__typename === 'BundleProduct'",
    componentName: 'ProductBundle',
    componentPath: '@castletech/pwa-module-product-bundle/lib/components/ProductBundle'
  })
);| prop | description | 
|---|---|
| condition | It can be a product attr, such as __typename | 
| componentName | Name of the component to be imported | 
| componentPath | Path of the component to be imported | 
4. Run project
yarn watch0.1.0
3 years ago