Explorar el Código

fix(core): fixes ES Module detection for default imports with relative paths or scoped packages (#2380)

FabianLars hace 4 años
padre
commit
b2b36cfe8d
Se han modificado 2 ficheros con 6 adiciones y 1 borrados
  1. 5 0
      .changes/fix-esm-detection.md
  2. 1 1
      core/tauri-codegen/src/embedded_assets.rs

+ 5 - 0
.changes/fix-esm-detection.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch
+---
+
+Fix ES Module detection for default imports with relative paths or scoped packages.

+ 1 - 1
core/tauri-codegen/src/embedded_assets.rs

@@ -196,7 +196,7 @@ impl EmbeddedAssets {
           "import \\*",
           "import (\"|');?$",
           "import\\(",
-          "import (.|\n)+ from (\"|')([A-Za-z\\-]+)(\"|')",
+          "import (.|\n)+ from (\"|')([A-Za-z/\\.@-]+)(\"|')",
           // export keywords
           "export\\{",
           "export \\{",