From fbf8caf5c419cb4fc3d123be910e094a8e8c4bef Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Sat, 14 Aug 2021 09:02:54 -0300 Subject: [PATCH] fix(core): ESM detection when using `export async function` (#2425) --- .changes/fix-esm-detection.md | 3 ++- core/tauri-codegen/src/embedded_assets.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.changes/fix-esm-detection.md b/.changes/fix-esm-detection.md index c96e70ff1..9bd6c327f 100644 --- a/.changes/fix-esm-detection.md +++ b/.changes/fix-esm-detection.md @@ -1,5 +1,6 @@ --- "tauri": patch +"tauri-codegen": patch --- -Fix ES Module detection for default imports with relative paths or scoped packages. +Fix ES Module detection for default imports with relative paths or scoped packages and exporting of async functions. diff --git a/core/tauri-codegen/src/embedded_assets.rs b/core/tauri-codegen/src/embedded_assets.rs index 824295409..b8eeba68c 100644 --- a/core/tauri-codegen/src/embedded_assets.rs +++ b/core/tauri-codegen/src/embedded_assets.rs @@ -202,7 +202,7 @@ impl EmbeddedAssets { "export \\{", "export\\*", "export \\*", - "export (default|class|let|const|function)", + "export (default|class|let|const|function|async)", ]) .unwrap() .is_match(&js)