fix: polyfill 'fetch' for Node target

This commit is contained in:
Christopher Willis-Ford 2022-05-04 10:14:52 -07:00
parent d331232a70
commit ebcbcdbae1

View file

@ -1,4 +1,5 @@
const path = require('path');
const {ProvidePlugin} = require('webpack');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const base = {
@ -64,6 +65,11 @@ module.exports = [
'js-md5': true,
'localforage': true,
'text-encoding': true
}
},
plugins: [
new ProvidePlugin({
fetch: ['node-fetch', 'default']
})
]
})
];