Set Up Your ns.package.json and distro.json Files

To set up your ns.package.json file:

  1. Open your root CCT module directory.

  2. Create a new file in the custom module and name it ns.package.json.

    For example:

    ../SC.CCT.ImageViewer@0.0.1/ns.package.json

  3. Build the ns.package.json file using the following code:

                    {
       "gulp": {
          "javascript": [
             "JavaScript/*"
          ]
       ,   "templates": [
             "Templates/*"
          ]
       }
    } 
    
                  
    Note:

    If your CCT includes any custom Sass, SuiteScript, services, or configuration files, you must account for these files here as well.

To set up your distro.json file:

  1. Open the distro.json file.

    • If implementing SCA 2019.2 or later, the distro.json file is located in the Advanced directory of the SCA source code. Examples: SC_20.1/Advanced/distro.json, SC_19.2_Live/Advanced/distro.json

    • If implementing SCA 2019.1 or earlier, this file is located in the top-level directory of your SCA development directory.

  2. Add an entry for the new CCT module in the modules object to ensure that the Gulp tasks include your code when you deploy to NetSuite. It should look similar to the following examples.

    • If implementing SCA 2019.2 or later, it should look similar to:

                          {
          "name": "SuiteCommerce Advanced Live",
          "version": "2.0",
          "modules": {
                  //...
              "../Advanced/SC.CCT.Html": "1.0.0",
              "../Advanced/SC.CCT.ImageViewer": "0.0.1",
            //...
      } 
      
                        
    • If implementing SCA 2019.1 or earlier, it should look similar to:

                          {
          "name": "SuiteCommerce Advanced 1.0.0",
          "version": "1.0.0",
          "modules": {
                  //...
              "suitecommerce/SC.CCT.Html": "1.0.0",
              "suitecommerce/SC.CCT.ImageViewer": "0.0.1",
            //...
      } 
      
                        
  3. Define any application dependencies for the preferred application (Shopping, My Account, or Checkout), within the javascript object.

    For the example ImageViewer CCT, you add the module to the SC.Shopping.Starter entry point.

                    //...
    "javascript": [
        {
            "entryPoint": "SC.Shopping.Starter",
            "exportFile": "shopping.js",
            "dependencies": [
                "Backbone.View.Plugins",
                "jQuery.html",
                "ItemDetails",
            //...
                "SC.CCT.Html",
                "SC.CCT.ImageViwer"
                   ],
    //... 
    
                  
  4. If your CCT includes any Sass, include the module definition in the dependencies array of the preferred application (Shopping, My Account, or Checkout) within the sass object.

    For the example ImageViewer CCT, your code might look similar to:

                    //...
          "sass": {
             //...
             "applications": [
                {
                   "name": "Shopping",
                   "exportFile": "shopping.css",
                   "dependencies": [
                      {
                      //...
                      "PickupInStore",
                      "Location.SCA",
                      "SC.CCT.ImageViewer"
                   ]
    //... 
    
                  
  5. Save the distro.json file.

  6. If you have not already set your NetSuite records, complete the tasks as defined in Custom Content Type.

    Important:

    Creating a custom module is only one step in the process. You must still perform the steps necessary to set up your custom module for use in SMT.

  7. Test your custom module in your local environment or deploy to your NetSuite account. See Develop Your SCA Customization for details.

Related Topics

Create Custom Content Types for SMT
Create a Custom Module for Your CCT
Create an Entry Point File
Create a View File
Create a Template File

General Notices