浏览代码

fix(cli): web_dev_server html template serialization (fix #6165) (#6166)

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Alain Nicolas Schneble 2 年之前
父节点
当前提交
314f0e212f
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. 6 0
      .changes/fix-dev-server-html-serialization.md
  2. 1 1
      tooling/cli/src/helpers/web_dev_server.rs

+ 6 - 0
.changes/fix-dev-server-html-serialization.md

@@ -0,0 +1,6 @@
+---
+"cli.rs": patch
+"cli.js": patch
+---
+
+Fixes HTML serialization removing template tags on the dev server.

+ 1 - 1
tooling/cli/src/helpers/web_dev_server.rs

@@ -126,7 +126,7 @@ async fn handler<T>(req: Request<T>, state: Arc<State>) -> impl IntoResponse {
           head.prepend(script_el);
         });
 
-        f = document.to_string().as_bytes().to_vec();
+        f = tauri_utils::html::serialize_node(&document);
       }
 
       (StatusCode::OK, [(CONTENT_TYPE, mime_type)], f)