When you use Salesforce B2C Commerce JavaScript, library and package import features can speed development.
JavaScript libraries can be shared across cartridges using the importScript("cartridgename:path/scriptname.ds") syntax (the cartridge name is optional if the script is located in the current cartridge). This is also the case for JavaScript pipelets, which can be stored in a dedicated cartridge, so they can be used from other cartridges.
Feature | Call | Description |
---|---|---|
Import packages | importPackages( dw.util
); |
Reuse processes that are outside the pipeline |
Import class | importClass( dw.util.HashMap
); |
Reuse classes that are outside the pipeline |
Library mechanism | importScript(
"mylib:export/orderhandling.ds" ); |
Reuse scripts that are outside the pipeline |