You can test your extension customizations on a local server before deploying to NetSuite. The local server is installed as part of the Node.js installation and uses the Express web framework.
This command compiles all source files into combined files within a LocalDistribution/tmp directory.
Typically, you test your code locally before deploying to a live site in a NetSuite account. However, if you are developing an extension that includes SuiteScript or configuration (JSON) files, you must deploy your files to your account and activate the extension for these changes to accessible by the local server. SuiteScript includes services, which do not exist in your account’s backend until you deploy them. Likewise, changes to configuration JSON files do not apply to a domain until deployed. See Manage Themes and Extensions.
If you modify any manifest files, you must restart your local server to see changes.
To test your extension on a local server:
If you have not already done so, fetch the active theme.
This is required before you can test an extension locally. See Fetch Active Theme and Extension Files for details.
Open a command line or terminal and access the top-level development directory. This is the same directory created when you extracted the Extension Developer Tools.
Run the following command:
If this is the first time you are running
gulp extension:local in this directory, this command creates a subdirectory called LocalDistribution. It then compiles the source files and outputs them to this directory.
Potential data loss. Besides compiling and deploying your extension to a local server, the
gulp extension:local command updates the manifest.json file for the extension. This action overwrites any manual changes you made to this file. To preserve any manual changes to your manifest.json file, run the
gulp extension:local --preserve-manifest command instead. See Extension Manifest for details on this file.
Navigate to the local version of the application using one of the following URLs:
My Account: http://<DOMAIN_NAME>/c.<ACCOUNT_ID>/SSP_APPLICATION/my_account-local.ssp
In the above URL patterns, you must replace the following variables with values for your specific environment:
DOMAIN_NAME — replace this value with the domain name configured for your NetSuite website record.
ACCOUNT_ID — replace this value with your NetSuite account ID.
SSP_APPLICATION — replace this value with the URL root that you are accessing.
For SuiteCommerce implementations, this variable should read scs. For example:
For SuiteCommerce Advanced (SCA), this variable equals the URL root of the SCA implementation. For example:
The URLs you use should be similar to the following examples: