mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
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:
+2
-1
@@ -11,7 +11,8 @@ function generateConfig(name) {
|
|||||||
filename: name + '.js',
|
filename: name + '.js',
|
||||||
sourceMapFilename: name + '.map',
|
sourceMapFilename: name + '.map',
|
||||||
library: 'axios',
|
library: 'axios',
|
||||||
libraryTarget: 'umd'
|
libraryTarget: 'umd',
|
||||||
|
globalObject: 'this'
|
||||||
},
|
},
|
||||||
node: {
|
node: {
|
||||||
process: false
|
process: false
|
||||||
|
|||||||
Reference in New Issue
Block a user