Feature/edge (#61)

* feat(lib) propagate edge feature to web-view crate

* feat(cli) add edge feature to config
This commit is contained in:
nothingismagick 2019-11-24 16:03:42 +01:00 committed by GitHub
parent fdbc556b8f
commit 19322a24e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 7 deletions

View File

@ -38,7 +38,7 @@ clap = {version = "2.33", features = ["yaml"]}
includedir_codegen = "0.5.0"
[features]
# edge = ["webview-sys/edge"]
edge = ["web-view/edge"]
dev = []
embedded-server = []
all-api = []

View File

@ -12,7 +12,7 @@ const { appDir, tauriDir } = require('./helpers/app-paths')
const logger = require('./helpers/logger')
const log = logger('app:tauri', 'green')
const warn = log('app:tauri (template)', 'red')
const warn = logger('app:tauri (template)', 'red')
class Runner {
constructor () {
@ -45,10 +45,14 @@ class Runner {
this.url = url
const args = ['--url', url]
const features = ['dev']
if (cfg.tauri.edge) {
features.push('edge')
}
const startDevTauri = () => {
return this.__runCargoCommand({
cargoArgs: ['run', '--features', 'dev'],
cargoArgs: ['run', '--features', ...features],
extraArgs: args
})
}

View File

@ -1,12 +1,12 @@
const
path = require('path'),
distDir = path.resolve(__dirname, './dist')
path = require('path');
const distDir = path.resolve(__dirname, './dist')
module.exports = function () {
return {
build: {
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: {},
tauri: {
@ -25,6 +25,7 @@ module.exports = function () {
security: {
csp: 'default-src data: filesystem: ws: http: https: \'unsafe-eval\' \'unsafe-inline\''
}
}
},
edge: true
}
}