File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,11 @@ import "../webpack/module_federation";
33// The next import needs to be kept with parentheses, otherwise we get this error:
44// "Shared module is not available for eager consumption."
55import ( "./patterns" ) ;
6+
7+ // Register jQuery gloablly as soon as this script is executed.
8+ async function register_global_libraries ( ) {
9+ const jquery = ( await import ( "jquery" ) ) . default ;
10+ window . jQuery = jquery ;
11+ window . $ = jquery ;
12+ }
13+ register_global_libraries ( ) ;
Original file line number Diff line number Diff line change @@ -35,6 +35,13 @@ module.exports = () => {
3535 name : "patternslib" ,
3636 remote_entry : config . entry [ "bundle.min" ] ,
3737 dependencies : package_json . dependencies ,
38+ shared : {
39+ jquery : {
40+ singleton : true ,
41+ requiredVersion : package_json . dependencies [ "jquery" ] ,
42+ eager : true ,
43+ } ,
44+ } ,
3845 } )
3946 ) ;
4047
You can’t perform that action at this time.
0 commit comments