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
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,7 @@ Then you can use the `expose-loader` using two approaches.
44
44
## Inline
45
45
46
46
The `|` or `%20` (space) allow to separate the `globalName`, `moduleLocalName` and `override` of expose.
47
+
47
48
The documentation and syntax examples can be read [here](#syntax).
48
49
49
50
> [!WARNING]
@@ -115,7 +116,9 @@ module.exports = {
115
116
```
116
117
117
118
The [`require.resolve`](https://nodejs.org/api/modules.html#modules_require_resolve_request_options) call is a Node.js function (unrelated to `require.resolve` in webpack processing).
119
+
118
120
`require.resolve` that returns the absolute path of the module (`"/.../app/node_modules/jquery/dist/jquery.js"`).
121
+
119
122
So the expose only applies to the `jquery` module and it's only exposed when used in the bundle.
120
123
121
124
Finally, run `webpack` using the method you normally use (e.g., via CLI or an npm script).
@@ -263,6 +266,7 @@ type moduleLocalName = string;
263
266
Default: `undefined`
264
267
265
268
The name of method/variable etc of the module (the module must export it).
269
+
266
270
If `moduleLocalName` is specified, it exposes only the value of `moduleLocalName`.
267
271
268
272
**src/index.js**
@@ -304,7 +308,9 @@ type override = boolean;
304
308
Default: `false`
305
309
306
310
By default, loader does not override the existing value in the global object, because it is unsafe.
311
+
307
312
In `development` mode, we throw an error if the value already present in the global object.
313
+
308
314
But you can configure loader to override the existing value in the global object using this option.
309
315
310
316
To force override the value that is already present in the global object you can set the `override` option to the `true` value.
@@ -461,6 +467,7 @@ module.exports = {
461
467
## Contributing
462
468
463
469
We welcome all contributions!
470
+
464
471
If you're new here, please take a moment to review our contributing guidelines before submitting issues or pull requests.
0 commit comments