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