The distro.json and ns.package.json Files

This topic applies to

Applies to

SuiteCommerce Advanced


To determine which files to include with the Distribution folder of SuiteCommerce Advanced, Gulp.js uses two types of configuration files. These files are:

  • distro.json

  • ns.package.json

The distro.json file exists in the following location depending on your implementation:

  • If implementing the 2020.1 release and later, this file is located within the SC_xxx/Advanced directory within your root source directory. For example: SC_20.1/Advanced

  • If implementing 2019.2, this file is located within the *_Live/Advanced/ directory within your root source directory. For example: SC_19.2_Live/Advanced/

  • If implementing 2019.1 and earlier, this file is located within the top level of the SCA directory.

The distro.json file defines which modules are included within SuiteCommerce Advanced. It also specifies additional configuration information.

Gulp.js parses this file to determine which files within the Modules directory to combine or copy into the Distribution folder. The distro.json file contains the following parameters:

  • name: specifies the name of the application. By default this value is SuiteCommerce Advanced <version>.

  • version: specifies the application version.

  • modules: lists the modules SuiteCommerce Advanced uses. Each module is listed on a separate line and uses the following format:

    "<module_name>": "<module_version>"

    By default the SuiteCommerce Advanced modules are listed in alphabetical order because there are no dependencies between modules. However, when customizing SuiteCommerce Advanced, your modules may have dependencies on other modules. In that case, you must ensure that any required modules are listed before other modules.

  • taskConfig: defines the gulp tasks required by the build process. In general, you do not need to edit these tasks..

  • copy: specifies the source and target paths when copying files to the Distribution directory.

While the distro.json file defines the modules that are included in SuiteCommerce Advanced, the ns.package.json file determines which files within an individual module are included. Each module included in the distro.json must have a corrsponding ns.package.json file. This file must be at the top level of the module folder. The ns.package.json file uses the following structure:

JavaScript example

{ "gulp": { "javascript": [ "JavaScript/*.js" ] , "templates": [ "Templates/*.txt" ] , "ssp-libraries": [ "SuiteScript/*.js" ] , "": [ "SuiteScript/*" ] } }

TypeScript example

{ "gulp": { "javascript": [ "JavaScript/*.js" "JavaScript/*.ts ] , "templates": [ "Templates/*.txt" ] , "ssp-libraries": [ "SuiteScript/*.js" ] , "": [ "SuiteScript/*" ] } }

In the above JavaScript example, there is a mapping between file types and partial paths to the location of the files. In general, Gulp.js uses wildcards to specify the contents of a directory. For example, ”JavaScript/*.js" includes all files with the ”.js" extension that are in the JavaScript folder. However, when creating your own modules, you can point to specific files within a directory, for example:

... "javascript": [ "JavaScript/MyJavaScriptFile.js" ] ...

The types shown in the above examples (javascript, templates, services, etc.) correspond to a specific Gulp task. Gulp tasks determine how certain file types are handled. For example, the javascript Gulp task causes all JavaScript files within a distribution to be compiled into a single file. Other Gulp tasks are responsible for copying files from the Modules directory to the Distribution directory.

If you are using the 2019.2 release of SCA or later, many of the source files are written in TypeScript with .ts filename extensions. In this case, the ns.package.json file will include “JavaScript/*.ts” to include .ts files as JavaScript. For example:

... "javascript": [ "JavaScript/*.js", "JavaScript/*.ts" ] ...

NetSuite recommends that you use only the default Gulp tasks when creating or editing a module. To use a custom file type within ns.package.json, you must create your own custom Gulp task.

Gulp tasks are stored in the following location:



This directory is created when you install Gulp.js. It is not included in the downloaded version of the SuiteCommerce Advanced source directory. See Developer Environment for more information.