Skip to content

Commit

Permalink
fix: resolve vite outDir before passing to tauri cli
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Feb 28, 2022
1 parent 0094010 commit 99f648d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/build.ts
@@ -1,7 +1,7 @@
import { resolveConfig, build as viteBuild } from "vite";
import { getTauriConfPath } from "./utils";
import { logger } from "./logger";
import { relative, dirname } from "node:path";
import { relative, dirname, resolve } from "node:path";
import { init } from "./init";
import TauriCli from "@tauri-apps/cli";

Expand All @@ -25,11 +25,13 @@ export async function build(args?: string[]) {
build: {
distDir: relative(
// at this point, `tauriConfPath` can't be null,
// because we made sure to initialize tauri if it weren't and got the new path.
// because we made sure to initialize tauri if it wasn't and got the new path.
dirname(tauriConfPath as string),
(
await resolveConfig({}, "build", "production")
).build.outDir
resolve(
(
await resolveConfig({}, "build", "production")
).build.outDir
)
),
},
}),
Expand Down

0 comments on commit 99f648d

Please sign in to comment.