From 73031e74ec5ce735c67e2ef0ed8d6f66871ec984 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Sat, 23 Nov 2024 08:48:06 +0100 Subject: [PATCH] Make it so it's not required to manually call the copy-keycloak-resources-to-public script even in webpack projects --- src/bin/main.ts | 2 +- src/bin/update-kc-gen.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/bin/main.ts b/src/bin/main.ts index 54eaa5b7..3ff5c163 100644 --- a/src/bin/main.ts +++ b/src/bin/main.ts @@ -245,7 +245,7 @@ program .command({ name: "copy-keycloak-resources-to-public", description: - "(Webpack/Create-React-App only) Copy Keycloak default theme resources to the public directory." + "(Internal) Copy Keycloak default theme resources to the public directory." }) .task({ skip, diff --git a/src/bin/update-kc-gen.ts b/src/bin/update-kc-gen.ts index 21fa3fd5..b8f1a7f0 100644 --- a/src/bin/update-kc-gen.ts +++ b/src/bin/update-kc-gen.ts @@ -9,6 +9,16 @@ import { getIsPrettierAvailable, runPrettier } from "./tools/runPrettier"; export async function command(params: { buildContext: BuildContext }) { const { buildContext } = params; + run_copy_assets_to_public: { + if (buildContext.bundler !== "webpack") { + break run_copy_assets_to_public; + } + + const { command } = await import("./copy-keycloak-resources-to-public"); + + await command({ buildContext }); + } + const { hasBeenHandled } = maybeDelegateCommandToCustomHandler({ commandName: "update-kc-gen", buildContext