File tree Expand file tree Collapse file tree 4 files changed +7
-3
lines changed
src/Symfony/Component/AssetMapper
fixtures/importmaps/assets2 Expand file tree Collapse file tree 4 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -417,11 +417,11 @@ private function convertEntriesToImports(array $entries): array
417
417
$ this ->modulesToPreload [] = $ path ;
418
418
}
419
419
420
- $ dependencyImportMapEntries = array_map (function (AssetDependency $ dependency ) {
420
+ $ dependencyImportMapEntries = array_map (function (AssetDependency $ dependency ) use ( $ entryOptions ) {
421
421
return new ImportMapEntry (
422
422
$ dependency ->asset ->getPublicPathWithoutDigest (),
423
423
$ dependency ->asset ->getLogicalPath (),
424
- preload: !$ dependency ->isLazy ,
424
+ preload: $ entryOptions -> preload && !$ dependency ->isLazy ,
425
425
);
426
426
}, $ dependencies );
427
427
$ imports = array_merge ($ imports , $ this ->convertEntriesToImports ($ dependencyImportMapEntries ));
Original file line number Diff line number Diff line change @@ -77,7 +77,8 @@ public function testGetImportMapJson()
77
77
'/assets/pizza/index.js ' => '/assets/pizza/index-b3fb5ee31adaf5e1b32d28edf1ab8e7a.js ' ,
78
78
'/assets/popcorn.js ' => '/assets/popcorn-c0778b84ef9893592385aebc95a2896e.js ' ,
79
79
'/assets/imported_async.js ' => '/assets/imported_async-8f0cd418bfeb0cf63826e09a4474a81c.js ' ,
80
- 'other_app ' => '/assets/namespaced_assets2/app2-344d0d513d424647e7d8a394ffe5e4b5.js ' ,
80
+ 'other_app ' => '/assets/namespaced_assets2/app2-d5bf10c20bf9a0b77e67d78fcac301c5.js ' ,
81
+ '/assets/namespaced_assets2/imported.js ' => '/assets/namespaced_assets2/imported-9ab37dabcfe317fba77123a4e573d53b.js ' ,
81
82
]], json_decode ($ manager ->getImportMapJson (), true ));
82
83
}
83
84
Original file line number Diff line number Diff line change
1
+ import './imported.js' ;
2
+
1
3
console . log ( 'app2' ) ;
Original file line number Diff line number Diff line change
1
+ console . log ( 'imported.js' ) ;
You can’t perform that action at this time.
0 commit comments