Building Node.js Themes in Liferay Workspace

Liferay Workspace reserves the themes folder only for themes that are created with the Themes Generator. There are no Blade CLI-provided commands or Maven archetypes to generate a theme for this folder. You must leverage the Liferay Theme Generator from within the themes folder to create them; you can also copy a generated theme into the folder.

You’ll demo this theme management capability next. Be sure the Liferay Theme Generator’s required tooling is installed.

  1. Navigate to your workspace’s themes folder and run the following command:

    yo liferay-theme

    Follow the prompts to create your theme.

  2. Navigate into your new theme and run

    ./gradlew build

    Liferay Workspace builds the front-end theme using Gradle. Under the hood, Liferay’s Node Gradle Plugin is applied and used to build your theme.

  3. Workspace is smart enough to differentiate between theme types. For instance, you can’t copy a theme built with the Theme Generator into the wars folder and expect it to build. You can test if your project is recognized by workspace by running this command from workspace’s root folder:

    ./gradlew projects

    Your CLI should display your new theme under the themes project.

    Root project 'liferay-workspace'
    +--- Project ':themes'
    |    \--- Project ':themes:my-generated-theme'

    If you moved a WAR-style theme (Gradle/Maven-based) into the themes folder, it is not recognized by the Gradle projects command.

Excellent! You learned how generated themes are recognized in workspace and where they should reside. For more information on building Gradle/Maven-based themes in workspace, see its dedicated article.

« Setting Environment Configurations for Liferay WorkspaceBuilding Gradle/Maven Themes in Liferay Workspace »
Was this article helpful?
0 out of 0 found this helpful