Skip to content

Commit b2b36cf

Browse files
authored
fix(core): fixes ES Module detection for default imports with relative paths or scoped packages (#2380)
1 parent 8e48029 commit b2b36cf

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changes/fix-esm-detection.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
Fix ES Module detection for default imports with relative paths or scoped packages.

core/tauri-codegen/src/embedded_assets.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ impl EmbeddedAssets {
196196
"import \\*",
197197
"import (\"|');?$",
198198
"import\\(",
199-
"import (.|\n)+ from (\"|')([A-Za-z\\-]+)(\"|')",
199+
"import (.|\n)+ from (\"|')([A-Za-z/\\.@-]+)(\"|')",
200200
// export keywords
201201
"export\\{",
202202
"export \\{",

0 commit comments

Comments
 (0)