diff --git a/src/Symfony/Component/AssetMapper/Compiler/JavaScriptImportPathCompiler.php b/src/Symfony/Component/AssetMapper/Compiler/JavaScriptImportPathCompiler.php index 9a0546a23cda3..3fab0e6f50118 100644 --- a/src/Symfony/Component/AssetMapper/Compiler/JavaScriptImportPathCompiler.php +++ b/src/Symfony/Component/AssetMapper/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/src/Symfony/Component/AssetMapper/Tests/Compiler/JavaScriptImportPathCompilerTest.php b/src/Symfony/Component/AssetMapper/Tests/Compiler/JavaScriptImportPathCompilerTest.php index ba47fc4d30afc..a73c2a4f2cb10 100644 --- a/src/Symfony/Component/AssetMapper/Tests/Compiler/JavaScriptImportPathCompilerTest.php +++ b/src/Symfony/Component/AssetMapper/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]],