Gulp Command Reference for SCA Developer Tools

You must run gulp commands at the level of the folder containing the package.json file.

The following table lists the most commonly used gulp commands for the SCA developer tools:

Command

Description

gulp

Creates the local distribution directory if it does not exist. This command also compiles the source modules into a deployable application.

gulp deploy

Compiles the application and deploys it to NetSuite. As part of the compilation process, gulp deploy minimizes the application by removing all white space. This command also creates one or more deploy distribution directories, depending on your implementation, if they do not exist. See Contents of the Deploy and Local Distribution Directories for information about the output of this command.

In addition to compiling the application, this command creates the .nsdeploy file if it does not exist.

If you are using the 2019.2 release of SCA or later, running gulp deploy also compiles all project TypeScript files to JavaScript. TypeScript files have a .ts filename extension.

gulp deploy --account

Use the --account parameter only for release 2021.2.1 and later accounts that have account-specific domains.

Specify your account number with the gulp command to enable access to the NetSuite account. For example, if your account number is 123456, you can enter the following command to successfully authenticate and deploy to your NetSuite account:

gulp deploy --account 123456

For sandbox accounts, specify your account number as shown in this example:

gulp deploy --account 123456–sb1

For more information, see URLs for Account-Specific Domains.

gulp deploy --no-backup

Compiles and deploys the application, but does not upload a backup of the source files.

gulp deploy --nouglify

Compiles and deploys the application like gulp deploy, but does not compress the source files. This command is useful for debugging because it produces output files that are easier to read.

gulp deploy --source <source_type>

Compiles and deploys only the type of source files specified. Possible options are:

  • javascript

  • ssp-libraries

  • ssp-files

  • services

gulp deploy --to

Enables you to deploy to a different NetSuite account by overriding the settings defined in the .nsdeploy file.

gulp jshint

Runs the JSHint utility on the SuiteCommerce Advanced source files. This utility verifies and validates JavaScript files to help detect possible errors.

gulp local

Compiles the Sass and template files into a functional application, but does not compile the JavaScript files of the application. After compilation, this command starts a local server. This server watches for changes to the SuiteCommerce Advanced source files. After the server starts, any changes you make to a JavaScript file are automatically recompiled and visible in the browser. The server also watches for changes to the Sass and template files.

If you are using the 2019.2 release of SCA or later, running gulp local also compiles all project TypeScript files to JavaScript. TypeScript files have a .ts filename extension.

See Test SCA Customizations on a Local Server for more information.

This command outputs files to the local distribution directory. See Contents of the Deploy and Local Distribution Directories for information about the output of this command.

gulp clean

Removes the deploy and local distribution directories and the .nsdeploy file.

gulp configuration

Compiles the configuration properties of each source module to generate the configurationManifest.json file in your local distribution folder. Configuration properties for source modules are declared using the configuration property in a module’s ns.package.json file.

gulp copy

Copies any files declared using the copy property in a source module’s ns.package.json file. For example, if a source module requires specific static files be available in the NetSuite File Cabinet, you can use the copy property in the ns.package.json file to declare the folder that contains those files. This ensures the contents of the declared folder are copied to the output with the internal folder structure maintained.

gulp javascript

Compiles the project’s JavaScript output. The JavaScript files compiled are those specified using the javascript property in each source module’s ns.package.json file.

This command compiles the JavaScript output so that it is suitable for production.

gulp javascript --nouglify

Compiles the project’s JavaScript output, like gulp javascript, but does not compress the source files. This command is useful for debugging because it produces output files that are easier to read.

gulp ssp-files

Compiles and copies the .ssp files declared using the ssp-files property in each source module’s ns.package.json file. (Handlebar syntax can be used in the .ssp files.)

gulp ssp-libraries

Compiles the JavaScript files declared using the ssp-libraries property in each backend module’s ns.package.json file.

The ssp-libraries section of the distro.json file includes a reference to a list of all backend modules.

Related Topics

Gulp Commands
Gulp Command Reference for Theme and Extension Developer Tools

General Notices