Modifier

Partager via


Extend a module definition file

This article describes how to extend a module definition file. For example, you can create an extended module of another module to add new configuration fields.

When you extend a property that is an object, you must extend the whole object. For example, to add a configuration property to your extended module, you first copy the existing configuration properties from the parent module to the child module. You then add the desired property.

Examples

The following example of a module definition file shows how a core module can be extended by using a $ref command to the core script injector module.

{
    "$ref": "@d365-commerce-modules/core-components/dist/lib/modules/script-injector/script-injector.definition.json",
    "friendlyName": "Analytics Service",
    "name": "AnalyticsService"
    ...
}

The $ref command can also include a relative path to another module in your /src/modules/ directory.

{
    "$ref": "../productFeature/productFeature.definition.json",
    "friendlyName": "Extended Product Feature Module",
    "name": "extendedProductFeature",
    "config": {
        "extendedProductData": {
            "friendlyName": "Extended Product Data",
            "description": "Additional product data.",
            "type": "string"
        }
    }
}

After deployment, both the base module and the extended module appear in Microsoft Dynamics 365 Commerce.

Additional resources

Request properties object

App settings

Platform settings file

Cookie API overview

Interactive components overview

Mock the signed-in state during local development

Configure module properties to be shown based on context

Globalize modules by using the CultureInfoFormatter class

Set up Azure Key Vault for secure key management