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

Commit a62d227

Browse files
committed
feat(build): set tauri output dir to dist_tauri
1 parent ad72b10 commit a62d227

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

__tests__/build.spec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ 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/bundled/index.html')).toBe(true)
9+
expect(project.has('dist_tauri/webpack_dist/index.html')).toBe(true)
1010
// Tauri app is built
11-
expect(project.has('src-tauri/target/release/app')).toBe(true)
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)
1214
})
1315
})

index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ module.exports = (api, options) => {
55
? options.pluginOptions.tauri
66
: {}
77

8-
api.chainWebpack(cfg => {
8+
api.chainWebpack((cfg) => {
99
if (process.env.TAURI_SERVE || process.env.TAURI_BUILD) {
1010
// Set IS_TAURI
1111
if (cfg.plugins.has('define')) {
12-
cfg.plugin('define').tap(args => {
12+
cfg.plugin('define').tap((args) => {
1313
args[0]['process.env'].IS_TAURI = true
1414
return args
1515
})
@@ -60,7 +60,7 @@ module.exports = (api, options) => {
6060
description: 'todo',
6161
usage: 'todo'
6262
},
63-
async args => {
63+
async (args) => {
6464
const build = require('tauri/dist/api/build')
6565
const { error } = require('@vue/cli-shared-utils')
6666

@@ -72,7 +72,7 @@ module.exports = (api, options) => {
7272
if (!args.skipBundle) {
7373
try {
7474
await api.service.run('build', {
75-
dest: 'dist_tauri/bundled'
75+
dest: 'dist_tauri/webpack_dist'
7676
})
7777
} catch (e) {
7878
error(
@@ -82,11 +82,12 @@ module.exports = (api, options) => {
8282
}
8383
}
8484

85+
process.env.CARGO_TARGET_DIR = api.resolve('dist_tauri')
8586
build({
8687
build: {
8788
// Has to be a non-empty string, value doesn't matter
8889
devPath: ' ',
89-
distDir: '../dist_tauri/bundled'
90+
distDir: '../dist_tauri/webpack_dist'
9091
},
9192
ctx: { debug: args.debug },
9293
verbose: args.verbose

0 commit comments

Comments
 (0)