You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+55-9Lines changed: 55 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,19 @@ For further hints on compatibility issues, check out [Shimming](https://webpack.
23
23
To begin, you'll need to install `expose-loader`:
24
24
25
25
```console
26
-
$ npm install expose-loader --save-dev
26
+
npm install expose-loader --save-dev
27
+
```
28
+
29
+
or
30
+
31
+
```console
32
+
yarn add -D expose-loader
33
+
```
34
+
35
+
or
36
+
37
+
```console
38
+
pnpm -D expose-loader
27
39
```
28
40
29
41
(If you're using WebPack 4, install `expose-loader@1` and follow the [corresponding instructions](https://v4.webpack.js.org/loaders/expose-loader/) instead.)
@@ -115,16 +127,35 @@ And run `webpack` via your preferred method.
115
127
116
128
### `exposes`
117
129
118
-
Type: `String|Object|Array<String|Object>`
130
+
Type:
131
+
132
+
```ts
133
+
typeexposes=
134
+
|string
135
+
| {
136
+
globalName:string|Array<string>;
137
+
moduleLocalName?:string;
138
+
override?:boolean;
139
+
}
140
+
|Array<
141
+
|string
142
+
| {
143
+
globalName:string|Array<string>;
144
+
moduleLocalName?:string;
145
+
override?:boolean;
146
+
}
147
+
>;
148
+
```
149
+
119
150
Default: `undefined`
120
151
121
152
List of exposes.
122
153
123
-
#### `String`
154
+
#### `string`
124
155
125
156
Allows to use a string to describe an expose.
126
157
127
-
##### `Syntax`
158
+
##### `syntax`
128
159
129
160
The `|` or `%20` (space) allow to separate the `globalName`, `moduleLocalName` and `override` of expose.
130
161
@@ -161,13 +192,18 @@ module.exports = {
161
192
};
162
193
```
163
194
164
-
#### `Object`
195
+
#### `object`
165
196
166
197
Allows to use an object to describe an expose.
167
198
168
199
##### `globalName`
169
200
170
-
Type: `String|Array<String>`
201
+
Type:
202
+
203
+
```ts
204
+
typeglobalName=string|Array<string>;
205
+
```
206
+
171
207
Default: `undefined`
172
208
173
209
The name in the global object. (**required**).
@@ -202,7 +238,12 @@ module.exports = {
202
238
203
239
##### `moduleLocalName`
204
240
205
-
Type: `String`
241
+
Type:
242
+
243
+
```ts
244
+
typemoduleLocalName=string;
245
+
```
246
+
206
247
Default: `undefined`
207
248
208
249
The name of method/variable/etc of the module (the module must export it).
@@ -237,7 +278,12 @@ module.exports = {
237
278
238
279
##### `override`
239
280
240
-
Type: `Boolean`
281
+
Type:
282
+
283
+
```ts
284
+
typeoverride=boolean;
285
+
```
286
+
241
287
Default: `false`
242
288
243
289
By default loader does not override the existing value in the global object, because it is unsafe.
0 commit comments