Skip to content

Commit

Permalink
fix: use a relative path when building, fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Jan 12, 2022
1 parent 08e811c commit 63a2f88
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"dependencies": {
"chalk": "4.1.2",
"find-up": "^6.2.0",
"got": "12.0.0"
},
"devDependencies": {
Expand Down
41 changes: 41 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { resolveConfig, build as viteBuild } from "vite";
import { initTauri, isTauriProject } from "./utils";
import { runOnCli } from "./tauri-cli";
import { logger } from "./logger";
import { relative, join, dirname } from "path";
import { findUp } from "find-up";

export async function build(args?: string[]): Promise<void> {
if (!isTauriProject()) {
Expand All @@ -16,9 +18,17 @@ export async function build(args?: string[]): Promise<void> {
{
config: {
build: {
distDir: (
await resolveConfig({}, "build", "production")
).build.outDir,
distDir: relative(
join(
dirname(
(await findUp("package.json")) ?? process.cwd() + "package.json"
),
"src-tauri"
),
(
await resolveConfig({}, "build", "production")
).build.outDir
),
},
},
},
Expand Down

0 comments on commit 63a2f88

Please sign in to comment.