Update Keycloakify

This commit is contained in:
Joseph Garrone
2024-02-23 20:10:39 +01:00
parent 991065a4d4
commit 1a7d9d7751
3 changed files with 36 additions and 12 deletions

View File

@ -5,12 +5,42 @@ import react from '@vitejs/plugin-react'
import commonjs from "vite-plugin-commonjs";
import { keycloakify } from "keycloakify/vite-plugin";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
commonjs(),
keycloakify()
keycloakify({
themeName: "keycloakify-starter",
extraThemeProperties: [
"foo=bar"
],
// This is a hook that will be called after the build is done
// but before the jar is created.
// You can use it to add/remove/edit your theme files.
postBuild: async keycloakifyBuildOptions => {
const fs = await import("fs/promises");
const path = await import("path");
await fs.writeFile(
path.join(keycloakifyBuildOptions.keycloakifyBuildDirPath, "foo.txt"),
Buffer.from(
[
"This file was created by the postBuild hook of the keycloakify vite plugin",
"",
"Resolved keycloakifyBuildOptions:",
"",
JSON.stringify(keycloakifyBuildOptions, null, 2),
""
].join("\n"),
"utf8"
)
);
}
})
],
/*
* Uncomment this if you want to use the default domain provided by GitHub Pages