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

Commit 9bcdf0e

Browse files
committed
fix(build): only use tauri-webpack when neccessary
Now it is only used if embeddedServer is active
1 parent 418ad14 commit 9bcdf0e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

index.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,18 @@ module.exports = (api, options) => {
88
api.chainWebpack(cfg => {
99
if (process.env.TAURI_BUILD) {
1010
// Setup require for no-server mode
11-
const TauriRequirePlugin = require('@tauri-apps/tauri-webpack/plugins/tauri-require')
12-
.plugin
13-
cfg.plugin('tauri-require').use(TauriRequirePlugin)
11+
const tauriConfig = require('tauri/dist/helpers/tauri-config')({
12+
build: {
13+
// Have to be empty strings
14+
distDir: '',
15+
devPath: ''
16+
}
17+
})
18+
if (!tauriConfig.tauri.embeddedServer.active) {
19+
const TauriRequirePlugin = require('@tauri-apps/tauri-webpack/plugins/tauri-require')
20+
.plugin
21+
cfg.plugin('tauri-require').use(TauriRequirePlugin)
22+
}
1423

1524
// Set IS_TAURI
1625
if (cfg.plugins.has('define')) {

0 commit comments

Comments
 (0)