Fetch Active Theme and Extension Files

This topic applies to

Applies to

SuiteCommerce Web Stores

Before you can deploy an extension or test it on a local server, you must first download files for the currently active theme by running the following command:

gulp extension:fetch

This command:

  • Downloads HTML and Sass files for the currently active theme. Do not modify these files. The Sass and HTML files downloaded using this command are for reference only.

  • Downloads files for any custom extensions that are currently activated.

The developer tools require theme files (HTML and Sass) to compile a local distribution for testing an extension on a local server. The developer tools also use these files to run a test compilation before deploying. When you fetch the active theme, you provide the necessary files in your local extension workspace. Later, when you test locally or deploy your extension, the developer tools can compile the code without error.

If you want to skip this step, you can run the gulp extension:deploy --skip-compilation command to deploy your extension files without running the compilation. For more Gulp.js commands used with extensions, see Extension Developer Gulp Commands.

The gulp extension:fetch command also fetches files for any custom extensions. When you fetch files for an active extension, you download these development files to your local extension workspace. You can now customize these files further development and testing.

Warning

When you fetch custom extension files, the developer tools download extension files that are activated for the specified domain. This action overwrites any extension files currently stored in your local workspace. This can result in loss of development files if you are not careful. To ensure that you do not lose any work under development, do not run the gulp extension:fetch command until you have deployed your extension work to NetSuite.


Note

This command does not download files for published extensions. A published extension is an extension installed into your account as part of a published SuiteApp. You cannot edit published content due to copyright restrictions.


Fetch the active theme files:

  1. In your local developer environment, open a command line or terminal and access the top-level extension development directory.

  2. Run the following command:

    gulp extension:fetch
  3. When prompted, enter the following information:

    • NetSuite Email – Enter the email address associated with your NetSuite account.

    • NetSuite Password – Enter your account password.

    • Choose Your Target Account and Role – Select the NetSuite account where SuiteCommerce application is installed. You must specify the correct role with required permissions for connecting to NetSuite.

      Important

      You must log in using the SCDeployer role to access your NetSuite account. Failure to use this role may result in an error. See Developer Tools Roles and Permissions for instructions on setting up this role.


    • Choose Your Website – Select your website with the domain you want to access.

    • Choose Your Domain – Select your domain with the active theme or extensions you want to download.

The gulp extension:fetch command creates a theme subdirectory in your Workspace/Extras directory. These files are for use by the developer tools only. Do not add, edit, delete, or move any files in this location.

You are now ready to perform either of the following tasks: