diff --git a/vite/vite-cli.mjs b/vite/vite-cli.mjs index ee1c5b89..c68cc7cf 100644 --- a/vite/vite-cli.mjs +++ b/vite/vite-cli.mjs @@ -37,7 +37,9 @@ if (command === "dev") { }) ); - server.openBrowser(); + if (options.openBrowser) { + server.openBrowser(); + } } else if (command === "build") { const resolvedConfig = await resolveConfig(config); console.log( diff --git a/vite/vite.sim.w b/vite/vite.sim.w index b8bd94bb..83a5e0f1 100644 --- a/vite/vite.sim.w +++ b/vite/vite.sim.w @@ -14,6 +14,7 @@ pub class Vite_sim { let cliFilename = Vite_sim.cliFilename(); let homeEnv = util.env("HOME"); let pathEnv = util.env("PATH"); + let openBrowser = util.env("WING_IS_TEST") != "true"; new cloud.Service(inflight () => { let url = Vite_sim.dev({ @@ -25,6 +26,7 @@ pub class Vite_sim { cliFilename: cliFilename, homeEnv: homeEnv, pathEnv: pathEnv, + openBrowser: openBrowser, }); state.set("url", url); });