diff --git a/Compiler/JavaScriptImportPathCompiler.php b/Compiler/JavaScriptImportPathCompiler.php index 82d6de9..78d056c 100644 --- a/Compiler/JavaScriptImportPathCompiler.php +++ b/Compiler/JavaScriptImportPathCompiler.php @@ -50,7 +50,7 @@ final class JavaScriptImportPathCompiler implements AssetCompilerInterface ) \s*[\'"`](\.\/[^\'"`\n]++|(\.\.\/)*+[^\'"`\n]++)[\'"`]\s*[;\)] ? - /mx'; + /mxu'; public function __construct( private readonly ImportMapConfigReader $importMapConfigReader, diff --git a/Tests/Compiler/JavaScriptImportPathCompilerTest.php b/Tests/Compiler/JavaScriptImportPathCompilerTest.php index 52a2ad9..2bb8473 100644 --- a/Tests/Compiler/JavaScriptImportPathCompilerTest.php +++ b/Tests/Compiler/JavaScriptImportPathCompilerTest.php @@ -172,6 +172,22 @@ public static function provideCompileTests(): iterable 'expectedJavaScriptImports' => ['/assets/other.js' => ['lazy' => false, 'asset' => 'other.js', 'add' => true]], ]; + yield 'static_named_import_with_unicode_character' => [ + 'input' => 'import { ɵmyFunction } from "./other.js";', + 'expectedJavaScriptImports' => ['/assets/other.js' => ['lazy' => false, 'asset' => 'other.js', 'add' => true]], + ]; + + yield 'static_multiple_named_imports' => [ + 'input' => << ['/assets/other.js' => ['lazy' => false, 'asset' => 'other.js', 'add' => true]], + ]; + yield 'static_import_everything' => [ 'input' => 'import * as myModule from "./other.js";', 'expectedJavaScriptImports' => ['/assets/other.js' => ['lazy' => false, 'asset' => 'other.js', 'add' => true]],