Skip to content

Commit cec21a9

Browse files
authored
docs: replace outdated references to libraryTarget with library.type (#7180)
1 parent 8a0f1dc commit cec21a9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/content/configuration/output.mdx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ contributors:
2929
- mrzalyaul
3030
- JakobJingleheimer
3131
- long76
32+
- tanyabouman
3233
---
3334

3435
The top-level `output` key contains a set of options instructing webpack on how and where it should output your bundles, assets, and anything else you bundle or load with webpack.
@@ -685,9 +686,9 @@ T> In some contexts properties will use JavaScript code expressions instead of r
685686

686687
`string = 'self'`
687688

688-
When targeting a library, especially when `libraryTarget` is `'umd'`, this option indicates what global object will be used to mount the library. To make UMD build available on both browsers and Node.js, set `output.globalObject` option to `'this'`. Defaults to `self` for Web-like targets.
689+
When targeting a library, especially when `library.type` is `'umd'`, this option indicates what global object will be used to mount the library. To make UMD build available on both browsers and Node.js, set `output.globalObject` option to `'this'`. Defaults to `self` for Web-like targets.
689690

690-
The return value of your entry point will be assigned to the global object using the value of `output.library.name`. Depending on the value of the `target` option, the global object could change respectively, e.g., `self`, `global`, or `globalThis`.
691+
The return value of your entry point will be assigned to the global object using the value of `output.library.name`. Depending on the value of the `type` option, the global object could change respectively, e.g., `self`, `global`, or `globalThis`.
691692

692693
For example:
693694

@@ -697,8 +698,10 @@ For example:
697698
module.exports = {
698699
// ...
699700
output: {
700-
library: 'myLib',
701-
libraryTarget: 'umd',
701+
library: {
702+
name: 'myLib',
703+
type: 'umd',
704+
},
702705
filename: 'myLib.js',
703706
globalObject: 'this',
704707
},
@@ -1394,7 +1397,7 @@ Note that omitting `library.name` will result in the assignment of all propertie
13941397
module.exports = {
13951398
//...
13961399
output: {
1397-
libraryTarget: 'umd',
1400+
type: 'umd',
13981401
},
13991402
};
14001403
```

0 commit comments

Comments
 (0)