Skip to content

Commit cdf0156

Browse files
jeffin143snitin315
andauthored
docs(config) : Change default value output.globalObject (#6025)
* docs(config) : Change default value output.globalObjecti * Update src/content/configuration/output.mdx Co-authored-by: Nitin Kumar <snitin315@gmail.com>
1 parent 2c3edce commit cdf0156

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/content/configuration/output.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,10 +656,12 @@ T> In some contexts properties will use JavaScript code expressions instead of r
656656

657657
## output.globalObject
658658

659-
`string = 'window'`
659+
`string = 'self'`
660660

661661
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.
662662

663+
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`.
664+
663665
For example:
664666

665667
**webpack.config.js**

0 commit comments

Comments
 (0)