- In your local developer environment, open a command line or terminal and access the top-level development directory.
- Run the following command:
gulp theme:localWarningPotential data loss. Besides compiling and deploying your theme to a local server, thegulp theme:localcommand 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-manifestcommand instead. See for details about this file. When you run thegulp theme:localcommand, it compiles all theme source files. For details see: - 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.sspIn the above URL patterns, you must replace the variables listed in the following table with values for your specific environment:
sca-dev-aconcaguasca-dev-2019–2Complete URLs for SuiteCommerce implementations would look like these examples:
http://www.mysite.com/c.123456/scs/shopping-local.ssphttp://www.mysite.com/c.123456/scs/my_account-local.sspComplete URLs for SuiteCommerce Advanced implementations would look like these examples:
http://www.mysite.com/c.123456/sca-dev-aconcagua/shopping-local.ssphttp://www.mysite.com/c.123456/sca-dev-2019–2/shopping-local.ssp
Important
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.
| 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: scsSuiteCommerce Advanced examples:sca-dev-aconcaguasca-dev-2019–2 |
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.