Test a Theme on a Local Server
You can test your theme customizations on a local server before deploying to NetSuite.
You can use the local server to test frontend changes. You must deploy and activate your theme to view any changes you made to skins or to Sass variables exposed to SMT.
To test your theme on a local server:
-
In your local developer environment, open a command line or terminal and access the top-level development directory.
-
Run the following command:
gulp theme:local
Warning:Potential data loss. Besides compiling and deploying your theme to a local server, the
gulp theme:local
command updates the manifest.json file for the theme. This action overwrites any manual changes you made to this file. To preserve any manual changes to your manifest.json file, run thegulp theme:local --preserve-manifest
command instead. See Edit the Theme Manifest for details about this file.When you run the
gulp theme:local
command, it compiles all theme source files. For details see: What Happens When You Test a Theme on a Local Server? -
To view your customized theme in a browser, navigate to the local version of the application using one of the following URLs:
-
http://<DOMAIN_NAME>/c.<ACCOUNT_ID>/<SSP_APPLICATION>/shopping-local.ssp
-
http://<DOMAIN_NAME>/c.<ACCOUNT_ID>/<SSP_APPLICATION>/my_account-local.ssp
-
http://<DOMAIN_NAME>/c.<ACCOUNT_ID>/<SSP_APPLICATION>/checkout-local.ssp
In the above URL patterns, you must replace the variables listed in the following table with values for your specific environment:
Variable
Replacement
Example
DOMAIN_NAME
Replace this value with the domain name configured for your NetSuite website record.
http://www.mysite.com
ACCOUNT_ID
Replace this value with your NetSuite account ID.
c.123456
SSP_APPLICATION
Replace this value with the URL root that you are accessing.
For SuiteCommerce implementations, this variable should read scs.
For SuiteCommerce Advanced (SCA), this variable equals the URL root of the SCA implementation.
SuiteCommerce example:
scs
SuiteCommerce Advanced examples:
-
sca-dev-aconcagua
-
sca-dev-2019–2
Complete URLs for SuiteCommerce implementations would look like these examples:
-
http://www.mysite.com/c.123456/scs/shopping-local.ssp
-
http://www.mysite.com/c.123456/scs/my_account-local.ssp
Complete URLs for SuiteCommerce Advanced implementations would look like these examples:
-
http://www.mysite.com/c.123456/sca-dev-aconcagua/shopping-local.ssp
-
http://www.mysite.com/c.123456/sca-dev-2019–2/shopping-local.ssp
-
If you add a new file or make changes to any overrides after launching the local server, you must run the gulp theme:local
command again to include the new changes. Gulp.js does not automatically compile new files or process overrides.
What Happens When You Test a Theme on a Local Server?
The gulp theme:local
command compiles all source files, including your theme and any extension customizations, into combined files within a LocalDistribution/tmp directory. This directory contains the Sass and template files used by the local version of the application.
When you run the command, the local server starts automatically. When the server starts, Gulp.js initializes watch tasks that listen for changes to files in the Templates and Sass directories. When you save changes to a file, gulp automatically recompiles the source files and updates the LocalDistribution directory. Gulp also outputs a message to the console when an update occurs.
Next Steps
After testing your theme locally and verifying its functionality, you can deploy it as described in Deploy a Theme to NetSuite.
Then you must activate the theme to apply it to your website domain. See Activating Themes and Extensions for instructions on activating your new theme for the domain or domains of your choice.