Skip to content

Commit

Permalink
fix(iis): deep merge IIS config
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariesly committed Apr 17, 2024
1 parent 69a7887 commit bd4d556
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/presets/iis.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { readFile } from "node:fs/promises";
import { resolve } from "pathe";
import { defu } from "defu";
import { resolveFile, writeFile } from "../utils";
import { defineNitroPreset } from "../preset";
import type { Nitro } from "../types";
Expand Down Expand Up @@ -116,7 +117,7 @@ async function iisnodeXmlTemplate(nitro: Nitro) {
await parseXmlDoc(fileString);

if (nitro.options.iis.mergeConfig && !nitro.options.iis.overrideConfig) {
return buildNewXmlDoc({ ...originalWebConfig, ...fileWebConfig });
return buildNewXmlDoc(defu(originalWebConfig, fileWebConfig));
} else if (nitro.options.iis.overrideConfig) {
return buildNewXmlDoc({ ...fileWebConfig });
}
Expand Down Expand Up @@ -149,7 +150,7 @@ async function iisXmlTemplate(nitro: Nitro) {
await parseXmlDoc(fileString);

if (nitro.options.iis.mergeConfig && !nitro.options.iis.overrideConfig) {
return buildNewXmlDoc({ ...originalWebConfig, ...fileWebConfig });
return buildNewXmlDoc(defu(originalWebConfig, fileWebConfig));
} else if (nitro.options.iis.overrideConfig) {
return buildNewXmlDoc({ ...fileWebConfig });
}
Expand Down

0 comments on commit bd4d556

Please sign in to comment.