Skip to content

Commit

Permalink
Add globalObject: 'this' to webpack config (axios#3176)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jezorko and jasonsaayman authored Sep 16, 2021
1 parent 8b9b402 commit d1bac49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ function generateConfig(name) {
filename: name + '.js',
sourceMapFilename: name + '.map',
library: 'axios',
libraryTarget: 'umd'
libraryTarget: 'umd',
globalObject: 'this'
},
node: {
process: false
Expand Down

0 comments on commit d1bac49

Please sign in to comment.