8000 Add globalObject: 'this' to webpack config (#3176) · darth-coder-js/axios@e52cd3a · GitHub
[go: up one dir, main page]

Skip to content

Commit e52cd3a

Browse files
Add globalObject: 'this' to webpack config (axios#3176)
This should solve the issue of undefined `this` when importing from an ES6 module. I've put steps to reproduce in [this comment](axios#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)
0