Skip to content
This repository was archived by the owner on Nov 9, 2023. It is now read-only.

Commit fe7b4b5

Browse files
committed
fix(build): use src-tauri/target instead of dist_tauri
1 parent 45a520e commit fe7b4b5

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

__tests__/build.spec.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ describe('tauri:build', () => {
66
const project = await create('build')
77
await project.run('vue-cli-service tauri:build')
88
// Web code is built
9-
expect(project.has('dist_tauri/webpack_dist/index.html')).toBe(true)
9+
expect(project.has('src-tauri/target/webpack_dist/index.html')).toBe(true)
1010
// Tauri app is built
11-
expect(project.has('dist_tauri/release/app')).toBe(true)
12-
expect(project.has('dist_tauri/release/bundle/appimage/app.AppImage')).toBe(true)
13-
expect(project.has('dist_tauri/release/bundle/deb/app_0.1.0_amd64.deb')).toBe(true)
11+
expect(project.has('src-tauri/target/release/app')).toBe(true)
12+
expect(
13+
project.has('src-tauri/target/release/bundle/appimage/app.AppImage')
14+
).toBe(true)
15+
expect(
16+
project.has('src-tauri/target/release/bundle/deb/app_0.1.0_amd64.deb')
17+
).toBe(true)
1418
})
1519
})

generator/index.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const execa = require('execa')
22
const { error } = require('@vue/cli-shared-utils')
3-
const fs = require('fs-extra')
43
const init = require('tauri/dist/api/init')
54

65
module.exports = async (api, options) => {
@@ -30,15 +29,4 @@ module.exports = async (api, options) => {
3029
'tauri:build': 'vue-cli-service tauri:build'
3130
}
3231
})
33-
api.onCreateComplete(() => {
34-
// Update .gitignore if it exists
35-
if (fs.existsSync(api.resolve('./.gitignore'))) {
36-
let gitignore = fs.readFileSync(api.resolve('./.gitignore'), 'utf8')
37-
if (!/(# Tauri build output|\/dist_tauri)/.test(gitignore)) {
38-
// Add /dist_tauri to .gitignore if it doesn't exist already
39-
gitignore = gitignore + '\n#Tauri build output\n/dist_tauri'
40-
fs.writeFileSync(api.resolve('./.gitignore'), gitignore)
41-
}
42-
}
43-
})
4432
}

index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ module.exports = (api, options) => {
7272
if (!args.skipBundle) {
7373
try {
7474
await api.service.run('build', {
75-
dest: 'dist_tauri/webpack_dist'
75+
dest: 'src-tauri/target/webpack_dist'
7676
})
7777
} catch (e) {
7878
error(
@@ -82,12 +82,11 @@ module.exports = (api, options) => {
8282
}
8383
}
8484

85-
process.env.CARGO_TARGET_DIR = api.resolve('dist_tauri')
8685
build({
8786
build: {
8887
// Has to be a non-empty string, value doesn't matter
8988
devPath: ' ',
90-
distDir: '../dist_tauri/webpack_dist'
89+
distDir: './target/webpack_dist'
9190
},
9291
ctx: { debug: args.debug },
9392
verbose: args.verbose

0 commit comments

Comments
 (0)