Skip to content

Commit 504fcb9

Browse files
docs: apply reviewer suggestions for configuration defaults section
1 parent 46e2c54 commit 504fcb9

1 file changed

Lines changed: 7 additions & 17 deletions

File tree

src/content/configuration/output.mdx

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,11 +1586,13 @@ T> Read the [authoring libraries guide](/guides/author-libraries/) guide for mor
15861586

15871587
### output.library.export
15881588

1589-
Specify which export should be exposed as a library.
1589+
Specify which part of your module should be exposed as the library when it is consumed by other applications.
1590+
1591+
By default, the entire module (namespace object) is exposed. However, in many cases, you may want to expose only a specific export, such as the default export or a particular function.
15901592

15911593
- Type: `string | string[]`
15921594

1593-
It is `undefined` by default, which will export the whole (namespace) object. The examples below demonstrate the effect of this configuration when using [`output.library.type: 'var'`](#type-var).
1595+
#### Example: exporting the default export
15941596

15951597
```js
15961598
export default {
@@ -1602,18 +1604,13 @@ export default {
16021604
},
16031605
},
16041606
};
1605-
```
1606-
1607-
The default export of your entry point will be assigned to the library name:
1607+
In this case, the default export of your entry module is assigned to the library name:
16081608

1609-
```js
1610-
// if your entry has a default export
16111609
const MyLibrary = _entry_return_.default;
1612-
```
1610+
Example: exporting a nested property
16131611

1614-
You can pass an array to `output.library.export` as well, it will be interpreted as a path to a module to be assigned to the library name:
1612+
You can also pass an array to define a path to a specific export:
16151613

1616-
```js
16171614
export default {
16181615
output: {
16191616
library: {
@@ -1623,14 +1620,7 @@ export default {
16231620
},
16241621
},
16251622
};
1626-
```
1627-
1628-
And here's the library code:
1629-
1630-
```js
16311623
const MyLibrary = _entry_return_.default.subModule;
1632-
```
1633-
16341624
### output.library.auxiliaryComment
16351625

16361626
Add a comment in the UMD wrapper.

0 commit comments

Comments
 (0)