فهرست منبع

Feature/edge (#61)

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

* feat(cli) add edge feature to config
nothingismagick 5 سال پیش
والد
کامیت
19322a24e6
3فایلهای تغییر یافته به همراه12 افزوده شده و 7 حذف شده
  1. 1 1
      lib/rust/Cargo.toml
  2. 6 2
      mode/runner.js
  3. 5 4
      tauri.conf.js

+ 1 - 1
lib/rust/Cargo.toml

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

+ 6 - 2
mode/runner.js

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

+ 5 - 4
tauri.conf.js

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