mirror of
https://github.com/tauri-apps/vue-cli-plugin-tauri.git
synced 2026-02-04 02:31:17 +01:00
chore(package): upgrade tauri
This commit is contained in:
@@ -2,9 +2,11 @@ const create = require('@vue/cli-test-utils/createTestProject')
|
||||
const { defaultPreset } = require('@vue/cli/lib/options')
|
||||
const path = require('path')
|
||||
|
||||
module.exports = projectName => {
|
||||
module.exports = (projectName) => {
|
||||
const preset = { ...defaultPreset }
|
||||
preset.plugins['vue-cli-plugin-tauri'] = {}
|
||||
preset.plugins['vue-cli-plugin-tauri'] = {
|
||||
appName: 'app'
|
||||
}
|
||||
delete preset.plugins['@vue/cli-plugin-eslint']
|
||||
|
||||
return create(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const execa = require('execa')
|
||||
const { error } = require('@vue/cli-shared-utils')
|
||||
const init = require('tauri/dist/api/init')
|
||||
const { init } = require('@tauri-apps/cli/dist/api/cli')
|
||||
|
||||
module.exports = async (api, options) => {
|
||||
await execa('cargo', ['tauri-bundler', '--version']).catch(() => {
|
||||
@@ -13,14 +13,9 @@ module.exports = async (api, options) => {
|
||||
init({
|
||||
directory: api.resolve('.'),
|
||||
appName: options.appName,
|
||||
customConfig: {
|
||||
build: null,
|
||||
tauri: {
|
||||
window: {
|
||||
title: options.windowTitle
|
||||
}
|
||||
}
|
||||
}
|
||||
windowTitle: options.windowTitle,
|
||||
distDir: 'Set automatically by Vue CLI plugin',
|
||||
devPath: 'Set automatically by Vue CLI plugin'
|
||||
})
|
||||
|
||||
api.extendPackage({
|
||||
|
||||
25
index.js
25
index.js
@@ -36,7 +36,7 @@ module.exports = (api, options) => {
|
||||
usage: 'todo'
|
||||
},
|
||||
async () => {
|
||||
const dev = require('tauri/dist/api/dev')
|
||||
const { dev } = require('@tauri-apps/cli/dist/api/cli')
|
||||
|
||||
// Use custom config for webpack
|
||||
process.env.TAURI_SERVE = true
|
||||
@@ -44,10 +44,10 @@ module.exports = (api, options) => {
|
||||
const server = await api.service.run('serve')
|
||||
|
||||
return dev({
|
||||
build: {
|
||||
// Has to be a valid dir, contents don't matter
|
||||
distDir: api.resolve('.'),
|
||||
devPath: server.url
|
||||
config: {
|
||||
build: {
|
||||
devPath: server.url
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -61,7 +61,7 @@ module.exports = (api, options) => {
|
||||
usage: 'todo'
|
||||
},
|
||||
async (args) => {
|
||||
const build = require('tauri/dist/api/build')
|
||||
const { build } = require('@tauri-apps/cli/dist/api/cli')
|
||||
const { error } = require('@vue/cli-shared-utils')
|
||||
|
||||
// Use custom config for webpack
|
||||
@@ -83,13 +83,14 @@ module.exports = (api, options) => {
|
||||
}
|
||||
|
||||
build({
|
||||
build: {
|
||||
// Has to be a non-empty string, value doesn't matter
|
||||
devPath: ' ',
|
||||
distDir: './target/webpack_dist'
|
||||
config: {
|
||||
build: {
|
||||
distDir: './target/webpack_dist'
|
||||
}
|
||||
},
|
||||
ctx: { debug: args.debug },
|
||||
verbose: args.verbose
|
||||
verbose: args.v || args.verbose || false,
|
||||
debug: args.d || args.debug || false,
|
||||
target: args.t || args.target || false
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
"pretest": "rimraf __tests__/temp_projects/*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/cli": "^1.0.0-beta-rc.1",
|
||||
"@vue/cli-shared-utils": "^4.1.1",
|
||||
"execa": "^3.4.0",
|
||||
"tauri": "^0.14.0"
|
||||
"execa": "^3.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli": "^4.1.1",
|
||||
|
||||
Reference in New Issue
Block a user