3
3
exports [` loader should work for a nested property for a global object: errors 1` ] = ` Array []` ;
4
4
5
5
exports [` loader should work for a nested property for a global object: module 1` ] = `
6
- "var ___EXPOSE_LOADER_IMPORT___ = require(\\ "-!./global-commonjs2-single-export.js\\ ");
6
+ "const globalObject4 = { foo : ' bar' } ;
7
+
8
+ module.exports = globalObject4;
9
+
10
+ var ___EXPOSE_LOADER_IMPORT___ = require(\\ "-!./global-commonjs2-single-export.js\\ ");
7
11
var ___EXPOSE_LOADER_GET_GLOBAL_THIS___ = require(\\ "../../src/runtime/getGlobalThis.js\\ ");
8
12
var ___EXPOSE_LOADER_GLOBAL_THIS___ = ___EXPOSE_LOADER_GET_GLOBAL_THIS___();
9
- var ___EXPOSE_LOADER_IMPORT_DEFAULT___ = ___EXPOSE_LOADER_IMPORT___.__esModule
10
- ? ___EXPOSE_LOADER_IMPORT___.default
11
- || ___EXPOSE_LOADER_IMPORT___
12
-
13
- : ___EXPOSE_LOADER_IMPORT___
14
13
if (!___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal\\ "]) ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal\\ "] = { } ;
15
- ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal\\ "][\\ "nested\\ "] = ___EXPOSE_LOADER_IMPORT_DEFAULT___ ;
16
- module.exports = ___EXPOSE_LOADER_IMPORT___; "
14
+ ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal\\ "][\\ "nested\\ "] = ___EXPOSE_LOADER_IMPORT___ ;
15
+ "
17
16
` ;
18
17
19
18
exports [` loader should work for a nested property for a global object: result 1` ] = `
@@ -31,25 +30,25 @@ Object {
31
30
32
31
exports [` loader should work for a nested property for a global object: warnings 1` ] = ` Array []` ;
33
32
34
- exports [` loader should work for nested preporties for a global object: errors 1` ] = ` Array []` ;
33
+ exports [` loader should work for nested properties for a global object: errors 1` ] = ` Array []` ;
35
34
36
- exports [` loader should work for nested preporties for a global object: module 1` ] = `
37
- "var ___EXPOSE_LOADER_IMPORT___ = require(\\ "-!./global-commonjs2-single-export.js\\ ");
35
+ exports [` loader should work for nested properties for a global object: module 1` ] = `
36
+ "const globalObject4 = { foo : ' bar' } ;
37
+
38
+ module.exports = globalObject4;
39
+
40
+ var ___EXPOSE_LOADER_IMPORT___ = require(\\ "-!./global-commonjs2-single-export.js\\ ");
38
41
var ___EXPOSE_LOADER_GET_GLOBAL_THIS___ = require(\\ "../../src/runtime/getGlobalThis.js\\ ");
39
42
var ___EXPOSE_LOADER_GLOBAL_THIS___ = ___EXPOSE_LOADER_GET_GLOBAL_THIS___();
40
- var ___EXPOSE_LOADER_IMPORT_DEFAULT___ = ___EXPOSE_LOADER_IMPORT___.__esModule
41
- ? ___EXPOSE_LOADER_IMPORT___.default
42
- || ___EXPOSE_LOADER_IMPORT___
43
-
44
- : ___EXPOSE_LOADER_IMPORT___
45
43
if (!___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal\\ "]) ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal\\ "] = { } ;
46
- ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal\\ "][\\ "nested\\ "] = ___EXPOSE_LOADER_IMPORT_DEFAULT___;
44
+ ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal\\ "][\\ "nested\\ "] = ___EXPOSE_LOADER_IMPORT___;
45
+ var ___EXPOSE_LOADER_IMPORT_NAMED___ = ___EXPOSE_LOADER_IMPORT___.foo
47
46
if (!___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myOtherGlobal\\ "]) ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myOtherGlobal\\ "] = { } ;
48
- ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myOtherGlobal\\ "][\\ "nested\\ "] = ___EXPOSE_LOADER_IMPORT_DEFAULT___ ;
49
- module.exports = ___EXPOSE_LOADER_IMPORT___; "
47
+ ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myOtherGlobal\\ "][\\ "nested\\ "] = ___EXPOSE_LOADER_IMPORT_NAMED___ ;
48
+ "
50
49
` ;
51
50
52
- exports [` loader should work for nested preporties for a global object: result 1` ] = `
51
+ exports [` loader should work for nested properties for a global object: result 1` ] = `
53
52
Object {
54
53
" ExposeLoader" : Object {
55
54
" foo" : " bar" ,
@@ -60,28 +59,25 @@ Object {
60
59
},
61
60
},
62
61
" myOtherGlobal" : Object {
63
- " nested" : Object {
64
- " foo" : " bar" ,
65
- },
62
+ " nested" : " bar" ,
66
63
},
67
64
}
68
65
` ;
69
66
70
- exports [` loader should work for nested preporties for a global object: warnings 1` ] = ` Array []` ;
67
+ exports [` loader should work for nested properties for a global object: warnings 1` ] = ` Array []` ;
71
68
72
69
exports [` loader should work from esModule export: errors 1` ] = ` Array []` ;
73
70
74
71
exports [` loader should work from esModule export: module 1` ] = `
75
- "var ___EXPOSE_LOADER_IMPORT___ = require(\\ "-!./global-module-default-export.js\\ ");
72
+ "const globalObject5 = { foo : ' bar' } ;
73
+
74
+ export default globalObject5;
75
+
76
+ var ___EXPOSE_LOADER_IMPORT___ = require(\\ "-!./global-module-default-export.js\\ ");
76
77
var ___EXPOSE_LOADER_GET_GLOBAL_THIS___ = require(\\ "../../src/runtime/getGlobalThis.js\\ ");
77
78
var ___EXPOSE_LOADER_GLOBAL_THIS___ = ___EXPOSE_LOADER_GET_GLOBAL_THIS___();
78
- var ___EXPOSE_LOADER_IMPORT_DEFAULT___ = ___EXPOSE_LOADER_IMPORT___.__esModule
79
- ? ___EXPOSE_LOADER_IMPORT___.default
80
- || ___EXPOSE_LOADER_IMPORT___
81
-
82
- : ___EXPOSE_LOADER_IMPORT___
83
- ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal\\ "] = ___EXPOSE_LOADER_IMPORT_DEFAULT___;
84
- module.exports = ___EXPOSE_LOADER_IMPORT___;"
79
+ ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal\\ "] = ___EXPOSE_LOADER_IMPORT___;
80
+ "
85
81
` ;
86
82
87
83
exports [` loader should work from esModule export: result 1` ] = `
@@ -92,27 +88,82 @@ Object {
92
88
},
93
89
},
94
90
" myGlobal" : Object {
95
- " foo" : " bar" ,
91
+ " default" : Object {
92
+ " foo" : " bar" ,
93
+ },
96
94
},
97
95
}
98
96
` ;
99
97
100
98
exports [` loader should work from esModule export: warnings 1` ] = ` Array []` ;
101
99
100
+ exports [` loader should work string config: errors 1` ] = ` Array []` ;
101
+
102
+ exports [` loader should work string config: module 1` ] = `
103
+ "const globalObject6 = { foo : ' bar' } ;
104
+ const globalObject7 = { bar : ' foo' } ;
105
+
106
+ export default function globalDef(){
107
+ return { bar: ' foo' };
108
+ } ;
109
+
110
+ export { globalObject6 , globalObject7 } ;
111
+
112
+ var ___EXPOSE_LOADER_IMPORT___ = require(\\ "-!./global-module-named-exports.js\\ ");
113
+ var ___EXPOSE_LOADER_GET_GLOBAL_THIS___ = require(\\ "../../src/runtime/getGlobalThis.js\\ ");
114
+ var ___EXPOSE_LOADER_GLOBAL_THIS___ = ___EXPOSE_LOADER_GET_GLOBAL_THIS___();
115
+ var ___EXPOSE_LOADER_IMPORT_NAMED___ = ___EXPOSE_LOADER_IMPORT___.globalObject6
116
+ if (!___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal_alias\\ "]) ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal_alias\\ "] = { } ;
117
+ ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal_alias\\ "][\\ "globalObject6\\ "] = ___EXPOSE_LOADER_IMPORT_NAMED___;
118
+ var ___EXPOSE_LOADER_IMPORT_NAMED___ = ___EXPOSE_LOADER_IMPORT___.globalObject7
119
+ if (!___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal_alias\\ "]) ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal_alias\\ "] = { } ;
120
+ ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal_alias\\ "][\\ "globalObject7\\ "] = ___EXPOSE_LOADER_IMPORT_NAMED___;
121
+ var ___EXPOSE_LOADER_IMPORT_NAMED___ = ___EXPOSE_LOADER_IMPORT___.default
122
+ if (!___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal_alias\\ "]) ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal_alias\\ "] = { } ;
123
+ ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal_alias\\ "][\\ "default\\ "] = ___EXPOSE_LOADER_IMPORT_NAMED___;
124
+ "
125
+ ` ;
126
+
127
+ exports [` loader should work string config: result 1` ] = `
128
+ Object {
129
+ " ExposeLoader" : Object {
130
+ " default" : Object {
131
+ " default" : [Function ],
132
+ " globalObject6" : Object {
133
+ " foo" : " bar" ,
134
+ },
135
+ " globalObject7" : Object {
136
+ " bar" : " foo" ,
137
+ },
138
+ },
139
+ },
140
+ " myGlobal_alias" : Object {
141
+ " default" : [Function ],
142
+ " globalObject6" : Object {
143
+ " foo" : " bar" ,
144
+ },
145
+ " globalObject7" : Object {
146
+ " bar" : " foo" ,
147
+ },
148
+ },
149
+ }
150
+ ` ;
151
+
152
+ exports [` loader should work string config: warnings 1` ] = ` Array []` ;
153
+
102
154
exports [` loader should work with multiple exposes: errors 1` ] = ` Array []` ;
103
155
104
156
exports [` loader should work with multiple exposes: module 1` ] = `
105
- "var ___EXPOSE_LOADER_IMPORT___ = require(\\ "-!./global-commonjs2-single-export.js\\ ");
157
+ "const globalObject4 = { foo : ' bar' } ;
158
+
159
+ module.exports = globalObject4;
160
+
161
+ var ___EXPOSE_LOADER_IMPORT___ = require(\\ "-!./global-commonjs2-single-export.js\\ ");
106
162
var ___EXPOSE_LOADER_GET_GLOBAL_THIS___ = require(\\ "../../src/runtime/getGlobalThis.js\\ ");
107
163
var ___EXPOSE_LOADER_GLOBAL_THIS___ = ___EXPOSE_LOADER_GET_GLOBAL_THIS___();
108
- var ___EXPOSE_LOADER_IMPORT_DEFAULT___ = ___EXPOSE_LOADER_IMPORT___.__esModule
109
- ? ___EXPOSE_LOADER_IMPORT___.default
110
- || ___EXPOSE_LOADER_IMPORT___
111
-
112
- : ___EXPOSE_LOADER_IMPORT___
113
- ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal\\ "] = ___EXPOSE_LOADER_IMPORT_DEFAULT___;
114
- ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myOtherGlobal\\ "] = ___EXPOSE_LOADER_IMPORT_DEFAULT___;
115
- module.exports = ___EXPOSE_LOADER_IMPORT___;"
164
+ ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal\\ "] = ___EXPOSE_LOADER_IMPORT___;
165
+ ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myOtherGlobal\\ "] = ___EXPOSE_LOADER_IMPORT___;
166
+ "
116
167
` ;
117
168
118
169
exports [` loader should work with multiple exposes: result 1` ] = `
@@ -134,16 +185,15 @@ exports[`loader should work with multiple exposes: warnings 1`] = `Array []`;
134
185
exports [` loader should work: errors 1` ] = ` Array []` ;
135
186
136
187
exports [` loader should work: module 1` ] = `
137
- "var ___EXPOSE_LOADER_IMPORT___ = require(\\ "-!./global-commonjs2-single-export.js\\ ");
188
+ "const globalObject4 = { foo : ' bar' } ;
189
+
190
+ module.exports = globalObject4;
191
+
192
+ var ___EXPOSE_LOADER_IMPORT___ = require(\\ "-!./global-commonjs2-single-export.js\\ ");
138
193
var ___EXPOSE_LOADER_GET_GLOBAL_THIS___ = require(\\ "../../src/runtime/getGlobalThis.js\\ ");
139
194
var ___EXPOSE_LOADER_GLOBAL_THIS___ = ___EXPOSE_LOADER_GET_GLOBAL_THIS___();
140
- var ___EXPOSE_LOADER_IMPORT_DEFAULT___ = ___EXPOSE_LOADER_IMPORT___.__esModule
141
- ? ___EXPOSE_LOADER_IMPORT___.default
142
- || ___EXPOSE_LOADER_IMPORT___
143
-
144
- : ___EXPOSE_LOADER_IMPORT___
145
- ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal\\ "] = ___EXPOSE_LOADER_IMPORT_DEFAULT___;
146
- module.exports = ___EXPOSE_LOADER_IMPORT___;"
195
+ ___EXPOSE_LOADER_GLOBAL_THIS___[\\ "myGlobal\\ "] = ___EXPOSE_LOADER_IMPORT___;
196
+ "
147
197
` ;
148
198
149
199
exports [` loader should work: result 1` ] = `
0 commit comments