Gulp Commands for Theme Development in NetSuite

Utilize Gulp commands for efficient theme development in NetSuite, including fetching, deploying, and validating themes.

·2 min read·1 views·View Oracle Docs

TL;DR Opening

This article details Gulp commands that facilitate theme development in NetSuite. These commands enhance workflows by allowing developers to fetch, compile, and deploy theme assets seamlessly.

What Are Gulp Commands?

Gulp commands are powerful tools used in theme development within NetSuite. They enable developers to automate tasks like fetching theme files, compiling assets, and deploying changes to custom themes. Utilizing Gulp can significantly streamline the development process.

Key Gulp Commands for Theme Development

Here’s a breakdown of essential Gulp commands that theme developers should know:

gulp theme:fetch

Downloads the active theme and extension files (like Sass, HTML, and other assets) for the specified domain. This command requires prior activation of a theme in the Manage Extensions wizard within NetSuite.

  • Usage:

    bash
    gulp theme:fetch
  • Account Parameter: For accounts with account-specific domains, specify your account number:

    bash
    gulp theme:fetch --account 123456

    For sandbox accounts:

    bash
    gulp theme:fetch --account 123456-sb1

gulp theme:local

Compiles Sass and HTML template files into a functional application and starts a local server that watches for file changes.

  • Usage:

    bash
    gulp theme:local

    Option: --preserve-manifest allows manual manifest updates without automatic regeneration:

    bash
    gulp theme:local --preserve-manifest

gulp theme:deploy

Compiles files into the DeployDistribution folder and updates the theme manifest. This command offers various options:

  • Standard Deployment: Prompts for theme information:

    bash
    gulp theme:deploy
  • Account Parameter: Enables deployment to account-specific domains:

    bash
    gulp theme:deploy --account 123456
  • Options:

    • --preserve-manifest: Deploy without updating the manifest.
    • --create: Create a new theme instead of updating.

gulp theme:update-manifest

Updates the theme's manifest.json file without deploying:

bash
gulp theme:update-manifest

Additional Commands

  • gulp validate: Validates the manifest.json file for accuracy.
  • gulp clear: Cleans the DeployDistribution and LocalDistribution directories.
  • gulp reactivate: Triggers reactivation of installed themes and extensions.

Considerations When Using Gulp

When using Gulp commands, it’s essential to follow best practices:

  • Ensure that your themes and extensions are activated properly in NetSuite.
  • Always validate the manifest files to avoid deployment errors.
  • Use the appropriate account parameters for deployments, especially for sandbox and production environments.

Who This Affects

  • Developers: Primarily those working on theme customization and extension development.
  • Administrators: Responsible for managing NetSuite themes and deployment processes.

Key Takeaways

  • Gulp commands are essential for automating theme development.
  • Proper usage of the --account parameter is crucial for accessing specific NetSuite environments.
  • Validation and careful management of theme assets promote a smooth development workflow.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

Do I need to activate themes in NetSuite before using the `gulp theme:fetch` command?
Yes, you need to activate the theme within the Manage Extensions wizard in NetSuite before using the `gulp theme:fetch` command.
Can I deploy a theme to a sandbox account using `gulp theme:deploy`?
Yes, you can deploy a theme to a sandbox account by using the `--account` parameter with the sandbox account number, for example: `gulp theme:deploy --account 123456-sb1`.
What does the `--preserve-manifest` option do in `gulp theme:local`?
The `--preserve-manifest` option allows you to manually update the theme manifest without automatic regeneration during the local server setup.
What happens if I run `gulp theme:update-manifest` without deployment?
Running `gulp theme:update-manifest` updates the theme's manifest.json file without triggering a deployment, which can be useful for ensuring the manifest is accurate before proceeding with further actions.
Source: Theme Developer Gulp Commands Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in General

View all General articles →