浏览代码

fix: Add WASM files to Vite Allow List and change devPath to localhost to fix Web Example (#5560)

Co-authored-by: Ben Wishovich <ben@benw.is>
Ben Wishovich 2 年之前
父节点
当前提交
878421beb7
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. 1 1
      examples/web/core/tauri/tauri.conf.json
  2. 6 0
      examples/web/vite.config.ts

+ 1 - 1
examples/web/core/tauri/tauri.conf.json

@@ -2,7 +2,7 @@
   "build": {
     "beforeBuildCommand": "yarn build:tauri",
     "beforeDevCommand": "yarn dev:tauri",
-    "devPath": "http://127.0.0.1:5173",
+    "devPath": "http://localhost:5173",
     "distDir": "../../build"
   },
   "package": {

+ 6 - 0
examples/web/vite.config.ts

@@ -25,6 +25,12 @@ if (TARGET === 'web') {
 }
 
 const config: UserConfig = {
+  server: {
+    fs: {
+      // Allow serving the wasm file from this folder.
+      allow: ['.']
+    }
+  },
   plugins,
   resolve: {
     alias: {