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](https://github.com/axios/axios/issues/1861#issuecomment-669832435).

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Paweł Szymański 2021-09-16 21:08:40 +02:00 committed by GitHub
parent f3ca6371ca
commit e52cd3ac64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,8 @@ function generateConfig(name) {
filename: name + '.js',
sourceMapFilename: name + '.map',
library: 'axios',
libraryTarget: 'umd'
libraryTarget: 'umd',
globalObject: 'this'
},
node: {
process: false