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" 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 = []

View File

@ -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
}) })
} }

View File

@ -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
} }
} }