small fix for library mode (#30645)
Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
parent
4745aecc70
commit
5dd6e1412d
1 changed files with 5 additions and 3 deletions
|
@ -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,
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue