mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
feat(tauri) use config as JSON (#214)
* feat(tauri.js): move to typescript * fix(tauri.js): properly export api as commonjs * feat(tauri.js): convert tauricon to typescript * fix(tauri.js/tauricon): type error * chore(tauri.js/package): update yarn.lock * chore(tauri.js/package): add build/pretest scripts * refactor(tauri.js/template): remove duplicate types * feat(tauri.js): use tauri.conf.json instead of .js * feat(tauri) read config using tauri.conf.json * fix(tauri) read devPath index.html from distDir * chore(examples) move to conf.json * chore(tauri.js) remove todo * fix(ci) TAURI_DIR env variable * fix(examples) move svelte-app config to tauri.conf.json * fix(examples): line endings tauri.conf.json * addition to previous commit * fix(test): EOF in tauri.conf.json Co-authored-by: Noah Klayman <noahklayman@gmail.com> Co-authored-by: nothingismagick <drthompsonsmagickindustries@gmail.com>
This commit is contained in:
committed by
nothingismagick
parent
8489a9a520
commit
a4e229ca10
30
examples/react/create-react-app/src-tauri/tauri.conf.json
Normal file
30
examples/react/create-react-app/src-tauri/tauri.conf.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"build": {
|
||||
"distDir": "../build",
|
||||
"devPath": "http://localhost:3000"
|
||||
},
|
||||
"ctx": {},
|
||||
"tauri": {
|
||||
"embeddedServer": {
|
||||
"active": true
|
||||
},
|
||||
"bundle": {
|
||||
"active": true
|
||||
},
|
||||
"whitelist": {
|
||||
"all": false
|
||||
},
|
||||
"window": {
|
||||
"title": "Tauri App"
|
||||
},
|
||||
"security": {
|
||||
"csp": "default-src data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
|
||||
},
|
||||
"edge": {
|
||||
"active": true
|
||||
},
|
||||
"automaticStart": {
|
||||
"active": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
const path = require('path')
|
||||
const distDir = path.resolve(__dirname, './build')
|
||||
|
||||
module.exports = function () {
|
||||
return {
|
||||
build: {
|
||||
distDir: distDir,
|
||||
devPath: 'http://localhost:3000' // devServer URL or html dir
|
||||
},
|
||||
ctx: {},
|
||||
tauri: {
|
||||
embeddedServer: {
|
||||
active: true
|
||||
},
|
||||
bundle: {
|
||||
active: true
|
||||
},
|
||||
whitelist: {
|
||||
all: false
|
||||
},
|
||||
window: {
|
||||
title: 'Tauri App'
|
||||
},
|
||||
security: {
|
||||
csp: 'default-src data: filesystem: ws: http: https: \'unsafe-eval\' \'unsafe-inline\''
|
||||
},
|
||||
edge: {
|
||||
active: true
|
||||
},
|
||||
automaticStart: {
|
||||
active: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
27
examples/react/gatsby-themed-site/src-tauri/tauri.conf.json
Normal file
27
examples/react/gatsby-themed-site/src-tauri/tauri.conf.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"build": {
|
||||
"distDir": "../public",
|
||||
"devPath": "http://localhost:8000"
|
||||
},
|
||||
"ctx": {},
|
||||
"tauri": {
|
||||
"embeddedServer": {
|
||||
"active": true
|
||||
},
|
||||
"bundle": {
|
||||
"active": true
|
||||
},
|
||||
"whitelist": {
|
||||
"all": false
|
||||
},
|
||||
"window": {
|
||||
"title": "Tauri App"
|
||||
},
|
||||
"security": {
|
||||
"csp": "default-src data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
|
||||
},
|
||||
"edge": {
|
||||
"active": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
const path = require('path')
|
||||
const distDir = path.resolve(__dirname, './public')
|
||||
|
||||
module.exports = function () {
|
||||
return {
|
||||
build: {
|
||||
distDir: distDir,
|
||||
devPath: 'http://localhost:8000' // devServer URL or html dir
|
||||
},
|
||||
ctx: {},
|
||||
tauri: {
|
||||
embeddedServer: {
|
||||
active: true
|
||||
},
|
||||
bundle: {
|
||||
active: true
|
||||
},
|
||||
whitelist: {
|
||||
all: false
|
||||
},
|
||||
window: {
|
||||
title: 'Tauri App'
|
||||
},
|
||||
security: {
|
||||
csp: 'default-src data: filesystem: ws: http: https: \'unsafe-eval\' \'unsafe-inline\''
|
||||
},
|
||||
edge: {
|
||||
active: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
30
examples/react/next.js/src-tauri/tauri.conf.json
Normal file
30
examples/react/next.js/src-tauri/tauri.conf.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"build": {
|
||||
"distDir": "../out",
|
||||
"devPath": "http://localhost:3000"
|
||||
},
|
||||
"ctx": {},
|
||||
"tauri": {
|
||||
"embeddedServer": {
|
||||
"active": true
|
||||
},
|
||||
"bundle": {
|
||||
"active": true
|
||||
},
|
||||
"whitelist": {
|
||||
"all": false
|
||||
},
|
||||
"window": {
|
||||
"title": "Tauri App"
|
||||
},
|
||||
"security": {
|
||||
"csp": "default-src data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
|
||||
},
|
||||
"edge": {
|
||||
"active": true
|
||||
},
|
||||
"automaticStart": {
|
||||
"active": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
const path = require('path')
|
||||
const distDir = path.resolve(__dirname, './out')
|
||||
|
||||
module.exports = function () {
|
||||
return {
|
||||
build: {
|
||||
distDir: distDir,
|
||||
devPath: 'http://localhost:3000' // devServer URL or html dir
|
||||
},
|
||||
ctx: {},
|
||||
tauri: {
|
||||
embeddedServer: {
|
||||
active: true
|
||||
},
|
||||
bundle: {
|
||||
active: true
|
||||
},
|
||||
whitelist: {
|
||||
all: false
|
||||
},
|
||||
window: {
|
||||
title: 'Tauri App'
|
||||
},
|
||||
security: {
|
||||
csp: 'default-src data: filesystem: ws: http: https: \'unsafe-eval\' \'unsafe-inline\''
|
||||
},
|
||||
edge: {
|
||||
active: true
|
||||
},
|
||||
automaticStart: {
|
||||
active: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
30
examples/svelte/svelte-app/src-tauri/tauri.conf.json
Normal file
30
examples/svelte/svelte-app/src-tauri/tauri.conf.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"build": {
|
||||
"distDir": "../public",
|
||||
"devPath": "http://localhost:5000"
|
||||
},
|
||||
"ctx": {},
|
||||
"tauri": {
|
||||
"embeddedServer": {
|
||||
"active": true
|
||||
},
|
||||
"bundle": {
|
||||
"active": true
|
||||
},
|
||||
"whitelist": {
|
||||
"all": false
|
||||
},
|
||||
"window": {
|
||||
"title": "Tauri App"
|
||||
},
|
||||
"security": {
|
||||
"csp": "default-src data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
|
||||
},
|
||||
"edge": {
|
||||
"active": true
|
||||
},
|
||||
"automaticStart": {
|
||||
"active": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
const path = require('path')
|
||||
const distDir = path.resolve(__dirname, './public')
|
||||
|
||||
module.exports = function () {
|
||||
return {
|
||||
build: {
|
||||
distDir: distDir,
|
||||
devPath: 'http://localhost:5000' // devServer URL or html dir
|
||||
},
|
||||
ctx: {},
|
||||
tauri: {
|
||||
embeddedServer: {
|
||||
active: true
|
||||
},
|
||||
bundle: {
|
||||
active: true
|
||||
},
|
||||
whitelist: {
|
||||
all: false
|
||||
},
|
||||
window: {
|
||||
title: 'Tauri App'
|
||||
},
|
||||
security: {
|
||||
csp: 'default-src data: filesystem: ws: http: https: \'unsafe-eval\' \'unsafe-inline\''
|
||||
},
|
||||
edge: {
|
||||
active: true
|
||||
},
|
||||
automaticStart: {
|
||||
active: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
27
examples/vanillajs/monolith/src-tauri/tauri.conf.json
Normal file
27
examples/vanillajs/monolith/src-tauri/tauri.conf.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"build": {
|
||||
"distDir": "../dist",
|
||||
"devPath": "http://localhost:4000"
|
||||
},
|
||||
"ctx": {},
|
||||
"tauri": {
|
||||
"embeddedServer": {
|
||||
"active": true
|
||||
},
|
||||
"bundle": {
|
||||
"active": true
|
||||
},
|
||||
"whitelist": {
|
||||
"all": true
|
||||
},
|
||||
"window": {
|
||||
"title": "Tauri App"
|
||||
},
|
||||
"security": {
|
||||
"csp": "default-src data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
|
||||
},
|
||||
"edge": {
|
||||
"active": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
const path = require('path')
|
||||
const distDir = path.resolve(__dirname, './dist')
|
||||
|
||||
module.exports = function () {
|
||||
return {
|
||||
build: {
|
||||
distDir: distDir,
|
||||
devPath: 'http://localhost:4000' // devServer URL or html dir
|
||||
},
|
||||
ctx: {},
|
||||
tauri: {
|
||||
embeddedServer: {
|
||||
active: true
|
||||
},
|
||||
bundle: {
|
||||
active: true
|
||||
},
|
||||
whitelist: {
|
||||
all: true
|
||||
},
|
||||
window: {
|
||||
title: 'Tauri App'
|
||||
},
|
||||
security: {
|
||||
csp: 'default-src data: filesystem: ws: http: https: \'unsafe-eval\' \'unsafe-inline\''
|
||||
},
|
||||
edge: {
|
||||
active: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,9 +24,6 @@ icon = [
|
||||
serde_json = "1.0.44"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
tiny_http = "0.6"
|
||||
phf = "0.8.0"
|
||||
includedir = "0.5.0"
|
||||
tauri = { path = "../../../../tauri", features = [ "all-api", "edge" ] }
|
||||
|
||||
[features]
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
#![cfg_attr(
|
||||
all(not(debug_assertions), target_os = "windows"),
|
||||
windows_subsystem = "windows"
|
||||
)]
|
||||
|
||||
mod cmd;
|
||||
|
||||
#[macro_use]
|
||||
|
||||
27
examples/vue/quasar-app/src-tauri/tauri.conf.json
Normal file
27
examples/vue/quasar-app/src-tauri/tauri.conf.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"build": {
|
||||
"distDir": "../dist/spa",
|
||||
"devPath": "http://localhost:7334"
|
||||
},
|
||||
"ctx": {},
|
||||
"tauri": {
|
||||
"embeddedServer": {
|
||||
"active": true
|
||||
},
|
||||
"bundle": {
|
||||
"active": true
|
||||
},
|
||||
"whitelist": {
|
||||
"all": true
|
||||
},
|
||||
"window": {
|
||||
"title": "Tauri App"
|
||||
},
|
||||
"security": {
|
||||
"csp": "default-src data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
|
||||
},
|
||||
"edge": {
|
||||
"active": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
const path = require('path')
|
||||
const distDir = path.resolve(__dirname, './dist/spa')
|
||||
|
||||
module.exports = function () {
|
||||
return {
|
||||
build: {
|
||||
distDir: distDir,
|
||||
devPath: 'http://localhost:7334' // devServer URL or html dir
|
||||
},
|
||||
ctx: {},
|
||||
tauri: {
|
||||
embeddedServer: {
|
||||
active: true
|
||||
},
|
||||
bundle: {
|
||||
active: true
|
||||
},
|
||||
whitelist: {
|
||||
all: true
|
||||
},
|
||||
window: {
|
||||
title: 'Tauri App'
|
||||
},
|
||||
security: {
|
||||
csp: 'default-src data: filesystem: ws: http: https: \'unsafe-eval\' \'unsafe-inline\''
|
||||
},
|
||||
edge: {
|
||||
active: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user