Nx Integrated Monorepo
Last updated
Last updated
Before You Start:
This documentation section is intended for cases where you already have an existing project and want to add a Keycloak theme as part of its deliverables.
One of Keycloakify’s strengths is its ability to let you reuse components and styles from your main application in your Keycloak theme. However, if you don’t have an existing codebase, it’s easier to and develop your Keycloak theme as a standalone project.
Let's see how to integrate a Keycloakify theme into a Nx project with integrated monorepo.
In this example we'll start with the Nx Vite starter
Next up we want to repatriate the Keycloakify Starter template sources. We only copy over the src and .storybook directory.
Now if you run npm run build-keycloak-theme
it will generate the JAR in dist/apps/keycloak-theme.
When you want to use the keycloakify CLI commands you can either cd into your keycloakify sub app directory or use the --project option of the Keycloakify CLI. Like for example if you want to run add-story you can do either:
cd apps/keycloak-theme && npx keycloakify add-story
OR
npx keycloakify add-story -p apps/keycloak-theme
from the root of your monorepo
To go beyond the base configuration you might want to explore what build options are available. Starting with with keycloakVersionTargets
to make sure that you only generates the JARs file you need.