small fix for library mode (#30645)

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
Erik Jan de Wit 2024-06-21 11:48:55 +02:00 committed by GitHub
parent 4745aecc70
commit 5dd6e1412d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,6 +9,7 @@ export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), ""); const env = loadEnv(mode, process.cwd(), "");
const external = ["react", "react/jsx-runtime", "react-dom"]; const external = ["react", "react/jsx-runtime", "react-dom"];
const plugins = [react(), checker({ typescript: true })]; const plugins = [react(), checker({ typescript: true })];
const input = env.LIB ? undefined : "src/main.tsx";
if (env.LIB) { if (env.LIB) {
external.push("react-router-dom"); external.push("react-router-dom");
external.push("react-i18next"); external.push("react-i18next");
@ -23,7 +24,9 @@ export default defineConfig(({ mode }) => {
formats: ["es"], formats: ["es"],
}, },
} }
: undefined; : {
outDir: "target/classes/theme/keycloak.v3/account/resources",
};
return { return {
base: "", base: "",
server: { server: {
@ -31,7 +34,6 @@ export default defineConfig(({ mode }) => {
port: 5173, port: 5173,
}, },
build: { build: {
outDir: "target/classes/theme/keycloak.v3/account/resources",
...lib, ...lib,
sourcemap: true, sourcemap: true,
target: "esnext", target: "esnext",
@ -39,7 +41,7 @@ export default defineConfig(({ mode }) => {
cssMinify: "lightningcss", cssMinify: "lightningcss",
manifest: true, manifest: true,
rollupOptions: { rollupOptions: {
input: "src/main.tsx", input,
external, external,
}, },
}, },