Skip to content

Commit

Permalink
Expose vite's host option
Browse files Browse the repository at this point in the history
andreterron committed Nov 26, 2024
1 parent 9eaca53 commit cadf6e2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/webapp/vite.config.ts
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ config({ path: process.env.DOTENV_CONFIG_PATH || "../../.env" });
export default defineConfig({
server: {
port: 8744,
host: parseHost(process.env.MAINFRAME_HOST),
},

plugins: [
@@ -34,3 +35,16 @@ export default defineConfig({
sourcemap: true,
},
});

function parseHost(input: string | undefined): boolean | string | undefined {
switch (input) {
case "true":
return true;
case "false":
return false;
case undefined:
return undefined;
default:
return input;
}
}

0 comments on commit cadf6e2

Please sign in to comment.