mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-03 02:09:50 +03:00
Feature/edge (#61)
* feat(lib) propagate edge feature to web-view crate * feat(cli) add edge feature to config
This commit is contained in:
parent
fdbc556b8f
commit
19322a24e6
@ -38,7 +38,7 @@ clap = {version = "2.33", features = ["yaml"]}
|
|||||||
includedir_codegen = "0.5.0"
|
includedir_codegen = "0.5.0"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# edge = ["webview-sys/edge"]
|
edge = ["web-view/edge"]
|
||||||
dev = []
|
dev = []
|
||||||
embedded-server = []
|
embedded-server = []
|
||||||
all-api = []
|
all-api = []
|
||||||
|
@ -12,7 +12,7 @@ const { appDir, tauriDir } = require('./helpers/app-paths')
|
|||||||
|
|
||||||
const logger = require('./helpers/logger')
|
const logger = require('./helpers/logger')
|
||||||
const log = logger('app:tauri', 'green')
|
const log = logger('app:tauri', 'green')
|
||||||
const warn = log('app:tauri (template)', 'red')
|
const warn = logger('app:tauri (template)', 'red')
|
||||||
|
|
||||||
class Runner {
|
class Runner {
|
||||||
constructor () {
|
constructor () {
|
||||||
@ -45,10 +45,14 @@ class Runner {
|
|||||||
this.url = url
|
this.url = url
|
||||||
|
|
||||||
const args = ['--url', url]
|
const args = ['--url', url]
|
||||||
|
const features = ['dev']
|
||||||
|
if (cfg.tauri.edge) {
|
||||||
|
features.push('edge')
|
||||||
|
}
|
||||||
|
|
||||||
const startDevTauri = () => {
|
const startDevTauri = () => {
|
||||||
return this.__runCargoCommand({
|
return this.__runCargoCommand({
|
||||||
cargoArgs: ['run', '--features', 'dev'],
|
cargoArgs: ['run', '--features', ...features],
|
||||||
extraArgs: args
|
extraArgs: args
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
const
|
const
|
||||||
path = require('path'),
|
path = require('path');
|
||||||
distDir = path.resolve(__dirname, './dist')
|
const distDir = path.resolve(__dirname, './dist')
|
||||||
|
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
return {
|
return {
|
||||||
build: {
|
build: {
|
||||||
distDir: distDir,
|
distDir: distDir,
|
||||||
APP_URL: 'http://localhost:4000' // must use a localhost server for now
|
APP_URL: 'http://localhost:4000' // must use a localhost server for now
|
||||||
},
|
},
|
||||||
ctx: {},
|
ctx: {},
|
||||||
tauri: {
|
tauri: {
|
||||||
@ -25,6 +25,7 @@ module.exports = function () {
|
|||||||
security: {
|
security: {
|
||||||
csp: 'default-src data: filesystem: ws: http: https: \'unsafe-eval\' \'unsafe-inline\''
|
csp: 'default-src data: filesystem: ws: http: https: \'unsafe-eval\' \'unsafe-inline\''
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
edge: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user