Skip to content

Commit b1452ee

Browse files
committed
fix webpack的fetch polyfill配置
1 parent f631ff1 commit b1452ee

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

build/webpack.base.conf.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var path = require('path')
2+
var webpack = require('webpack')
23
var config = require('../config/index')
34
var utils = require('./utils')
45
var projectRoot = path.resolve(__dirname, '../')
@@ -90,5 +91,11 @@ module.exports = {
9091
browsers: ['last 2 versions']
9192
})
9293
]
93-
}
94+
},
95+
plugins: [
96+
//[fetch polyfill](https://github.com/github/fetch)
97+
new webpack.ProvidePlugin({
98+
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
99+
}),
100+
]
94101
}

0 commit comments

Comments
 (0)