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";
3
3
// The next import needs to be kept with parentheses, otherwise we get this error:
4
4
// "Shared module is not available for eager consumption."
5
5
import ( "./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 = () => {
35
35
name : "patternslib" ,
36
36
remote_entry : config . entry [ "bundle.min" ] ,
37
37
dependencies : package_json . dependencies ,
38
+ shared : {
39
+ jquery : {
40
+ singleton : true ,
41
+ requiredVersion : package_json . dependencies [ "jquery" ] ,
42
+ eager : true ,
43
+ } ,
44
+ } ,
38
45
} )
39
46
) ;
40
47
You can’t perform that action at this time.
0 commit comments