Skip to content

Commit e52cd3a

Browse files
Add globalObject: 'this' to webpack config (#3176)
This should solve the issue of undefined `this` when importing from an ES6 module. I've put steps to reproduce in [this comment](#1861 (comment)). Co-authored-by: Jay <jasonsaayman@gmail.com>
1 parent f3ca637 commit e52cd3a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ function generateConfig(name) {
1111
filename: name + '.js',
1212
sourceMapFilename: name + '.map',
1313
library: 'axios',
14-
libraryTarget: 'umd'
14+
libraryTarget: 'umd',
15+
globalObject: 'this'
1516
},
1617
node: {
1718
process: false

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy